Esempio n. 1
0
        public async Task <IActionResult> GetDefaultRecipient()
        {
            var userEmail = GetUserEmail();

            if (userEmail == "error")
            {
                return(Unauthorized());
            }
            var recipient = await _recipientService.GetDefaultRecipient(userEmail);

            if (recipient == null)
            {
                return(NotFound(new { message = "Không tìm thấy người nhận" }));
            }
            return(Ok(_mapper.Map <RecipientForDefaultDto>(recipient)));
        }