Skip to content

Commit

Permalink
#13 added docs to list endpoint & updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mgroves committed Sep 19, 2023
1 parent 8032028 commit 88b637d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Conduit/Conduit.Web/Articles/Controllers/ArticlesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,16 @@ public async Task<IActionResult> Delete(string slug)
return Ok("Article deleted.");
}

/// <summary>
/// List Articles with the given criteria.
/// </summary>
/// <remarks>
/// <a href="https://realworld-docs.netlify.app/docs/specs/backend-specs/endpoints#list-articles">Conduit spec for List Articles Endpoint</a>
/// </remarks>
/// <param name="filter"></param>
/// <returns>List of articles</returns>
/// <response code="200">Successfully queryies articles</response>
/// <response code="422">Article request is invalid</response>
[HttpGet]
[Route("/api/articles")]
[AllowAnonymous]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,24 @@

public class ArticleFilterOptionsModel
{
/// <summary>
/// Filter articles to a given tag. (Optional)
/// </summary>
public string? Tag { get; set; }
/// <summary>
/// Filter articles to the given author by username (Optional)
/// </summary>
public string? Author { get; set; }
/// <summary>
/// Filter articles to those favorited by the given username (Optional)
/// </summary>
public string? Favorited { get; set; }
/// <summary>
/// Limit the number of articles returned (Default of 20, maximum of 50)
/// </summary>
public int? Limit { get; set; }
/// <summary>
/// Skip a number of articles (Default of 0)
/// </summary>
public int? Offset { get; set; }
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ This Conduit implementation is being streamed [live on Twitch](https://twitch.tv
4. (Manual alternative to step 3) Create the database objects collections, indexes, documents, indexes as described in the *comments* of the classes of the *Conduit.Migrations* project.
3. Configure Conduit.Web, Conduit.Tests and Conduit.Migrations
1. Add User Secrets to Conduit.Tests, Conduit.Web, and/or Conduit.Migrations, following secrets.json.template examples
2. You should use a separate bucket for integration tests, since integration tests will run "down" migrations and destroy anything in the bucket.
4. Compile and run Conduit.Web
1. Standard compile/run from command line/VSCode/Visual Studio/Rider should work fine
2. You can use Postman to exercise the endpoints. [RealWorld has a Postman collection available for your convenience](https://realworld-docs.netlify.app/docs/specs/backend-specs/postman) (which is currently checked into this repo, but beware--if you have issues, fall back to the official one).
Expand Down Expand Up @@ -95,6 +94,8 @@ An overview of the goals of this project and the Real World Conduit project, fea
| 2023-08-25 | Articles (lost to terrible connection) |
| 2023-09-05 | Update Article (two parts) | https://youtu.be/33i3X3fx7xw and https://www.youtube.com/watch?v=nve4yo9qt9o
| 2023-09-08 | Delete Article | https://youtu.be/5_bnbWWXvu0
| 2023-09-13 | CI, Unfavorite, List | https://www.youtube.com/watch?v=gPD14qrGpmM
| 2023-09-15 | List + benchmarks | https://www.youtube.com/watch?v=WwzgatFHihc

[YouTube Playlist - full streams](https://www.youtube.com/playlist?list=PLZWwU1YVRehL0psJRk35x8evMeeGAFwBa)

Expand Down

0 comments on commit 88b637d

Please sign in to comment.