Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions OpenAPI/LearningHub.Nhs.OpenApi/Controllers/BookmarkController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,28 @@ public BookmarkController(IBookmarkService bookmarkService)
this.bookmarkService = bookmarkService;
}

/// <summary>
/// <summary>
/// Gets all bookmarks by parent.
/// </summary>
/// <returns>Bookmarks.</returns>
[HttpGet]
[Route("GetAllByParent")]
public async Task<IEnumerable<UserBookmarkViewModel>> GetAllByParent()
{
return await this.bookmarkService.GetAllByParent(this.TokenWithoutBearer);
}

/// <summary>
/// The GetAllByParent.
/// </summary>
/// <param name="parentId">The parentId.</param>
/// <param name="all">The all.</param>
/// <returns>The <see cref="Task{IActionResult}"/>.</returns>
[HttpGet]
[Route("GetAllByParent")]
[Route("GetAllByParent/{parentId?}")]
public async Task<IActionResult> GetAllByParent(int? parentId, bool? all = false)
{
var bookmarks = await this.bookmarkService.GetAllByParent(this.CurrentUserId.GetValueOrDefault(), parentId, all);
return this.Ok(bookmarks);
if (this.CurrentUserId.GetValueOrDefault() != null)
{
var bookmarks = await this.bookmarkService.GetAllByParent(this.CurrentUserId.GetValueOrDefault(), parentId, all);
return this.Ok(bookmarks);
}
else
{
return this.Ok(await this.bookmarkService.GetAllByParent(this.TokenWithoutBearer));
}
}


/// <summary>
/// The Create.
/// </summary>
Expand Down
Loading