public IActionResult get(string?page, string?q) { Pageable? pageable = PageableUtil.convert(page); PaginatedList <Tag> tags = tagService.GetAll(pageable); Response.Headers.Add("X-Data-Count", tags.TotalCount.ToString()); return(Ok(tags)); }
public IActionResult get(string?page, string?q) { Pageable?pageable = PageableUtil.convert(page); PaginatedList <Category> posts = categoryService.GetAll(pageable); Response.Headers.Add("X-Data-Count", posts.TotalCount.ToString()); return(Ok(posts)); }
public IActionResult getNotifications(string?page, bool all = false) { Pageable?pageable = PageableUtil.convert(page); var userId = int.Parse( httpContextAccessor.HttpContext?.User.FindFirstValue(ClaimTypes .NameIdentifier) ?? throw new Exception()); PaginatedList <Notification> notifications; if (all) { notifications = notificationService.GetAllByUserId(userId, pageable); } else { notifications = notificationService.GetAllUnreadByUserId(userId, pageable); } return(Ok(notifications)); }
public IActionResult getCommentsForPost(string page, int postId) { Pageable?pageable = PageableUtil.convert(page); return(Ok(commentService.GetAllByPostId(postId, pageable))); }
public IActionResult get(string?page, string?q) { Pageable?pageable = PageableUtil.convert(page); return(Ok(postService.GetAll(pageable))); }