public ActionResult <IEnumerable <Comment> > GetCommentsByProfileId(string id) { try { IEnumerable <Comment> comments = _commentService.GetCommentsByCreatorId(id); return(Ok(comments)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public async Task <ActionResult <IEnumerable <Comment> > > GetCommentsByCreatorId() { try { Account userInfo = await HttpContext.GetUserInfoAsync <Account>(); Account currentUser = _service.GetOrCreateAccount(userInfo); IEnumerable <Comment> comments = _commentService.GetCommentsByCreatorId(currentUser.Id); return(Ok(comments)); } catch (Exception e) { return(BadRequest(e.Message)); } }