Add sorting columns

This commit is contained in:
Neil Brommer 2022-04-19 13:04:38 -07:00
parent adf24cbd5c
commit 90adbcfb7c
34 changed files with 833 additions and 80 deletions

View file

@ -54,9 +54,9 @@ namespace Start.Server.Controllers {
[Route("Create")]
[ProducesResponseType(StatusCodes.Status201Created, Type = typeof(BookmarkContainerDto))]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
public async Task<IActionResult> CreateBookmarkContainer([FromBody] string title) {
public async Task<IActionResult> CreateBookmarkContainer(string title, int sortOrder) {
BookmarkContainerDto? container = (await this.bookmarkContainerService
.CreateBookmarkContainer(this.GetAuthorizedUserId(), title))
.CreateBookmarkContainer(this.GetAuthorizedUserId(), title, sortOrder))
?.MapToDto();
if (container == null)

View file

@ -37,9 +37,9 @@ namespace Start.Server.Controllers {
[ProducesResponseType(StatusCodes.Status201Created, Type = typeof(BookmarkGroupDto))]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
public async Task<IActionResult> CreateBookmarkGroup(string title, string color,
int bookmarkContainerId) {
int sortOrder, int bookmarkContainerId) {
BookmarkGroup? newGroup = await this.bookmarkGroupService
.CreateBookmarkGroup(this.GetAuthorizedUserId(), title, color, bookmarkContainerId);
.CreateBookmarkGroup(this.GetAuthorizedUserId(), title, color, sortOrder, bookmarkContainerId);
if (newGroup == null)
return BadRequest();

View file

@ -37,9 +37,10 @@ namespace Start.Server.Controllers {
[ProducesResponseType(StatusCodes.Status201Created, Type = typeof(BookmarkDto))]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
public async Task<IActionResult> CreateBookmark(string title, string url, string? notes,
int bookmarkGroupId) {
int sortOrder, int bookmarkGroupId) {
BookmarkDto? bookmark = (await this.bookmarkService
.CreateBookmark(this.GetAuthorizedUserId(), title, url, notes, bookmarkGroupId))
.CreateBookmark(this.GetAuthorizedUserId(), title, url, notes, sortOrder,
bookmarkGroupId))
?.MapToDto();
if (bookmark == null)