From dcf5af31ad90f5e0e78b9c9cc682aa22ff2df057 Mon Sep 17 00:00:00 2001 From: "Matthew D. Groves" Date: Tue, 19 Sep 2023 10:16:54 -0400 Subject: [PATCH] #14 docs for feed endpoint --- .../Articles/Controllers/ArticlesController.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Conduit/Conduit.Web/Articles/Controllers/ArticlesController.cs b/Conduit/Conduit.Web/Articles/Controllers/ArticlesController.cs index a3b4d142ac..a7e4c480b7 100644 --- a/Conduit/Conduit.Web/Articles/Controllers/ArticlesController.cs +++ b/Conduit/Conduit.Web/Articles/Controllers/ArticlesController.cs @@ -242,9 +242,9 @@ public async Task Delete(string slug) /// /// Conduit spec for List Articles Endpoint /// - /// + /// Filtering options /// List of articles - /// Successfully queryies articles + /// Successfully queryied articles /// Article request is invalid [HttpGet] [Route("/api/articles")] @@ -272,15 +272,25 @@ public async Task GetArticles([FromQuery] ArticleFilterOptionsMod return Ok(new { articles = getArticlesResponse.ArticlesView }); } + /// + /// Feed (latest articles created by users that the logged-in user follows) + /// + /// + /// Conduit spec for Feed Articles Endpoint + /// + /// Options + /// List of articles + /// Successfully queryied articles + /// Article request is invalid [HttpGet] [Route("/api/articles/feed")] - public async Task GetFeed([FromQuery] ArticleFeedOptionsModel filter) + public async Task GetFeed([FromQuery] ArticleFeedOptionsModel options) { // get auth info var claims = _authService.GetAllAuthInfo(Request.Headers["Authorization"]); var username = claims.Username.Value; - var getArticlesRequest = new GetFeedRequest(username, filter); + var getArticlesRequest = new GetFeedRequest(username, options); var getArticlesResponse = await _mediator.Send(getArticlesRequest); if (getArticlesResponse.IsFailure)