Esempio n. 1
0
        public async Task <IActionResult> GetPublicationByIdUser(int idUser)
        {
            try
            {
                var resp = await _publicationServices.GetPublicationByIdUser(idUser);

                if (resp == null)
                {
                    return(NotFound(new { message = $"Usuario con Id = {idUser} no encontrado" }));
                }

                return(Ok(resp));
            }
            catch (Exception e)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, new { message = e.Message }));
            }
        }