Add more data access services

This commit is contained in:
Neil Brommer 2021-11-13 17:19:28 -08:00
parent 691e049103
commit d18dea826e
12 changed files with 333 additions and 45 deletions

View file

@ -30,14 +30,20 @@ namespace Start.Server.Controllers {
}
*/
[HttpPost]
public Bookmark CreateBookmark(string title, string url, string? notes,
int bookmarkGroupId) {
string userId = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
return bookmarkService.CreateBookmark(userId, title, url, notes, bookmarkGroupId);
[HttpGet]
public (BookmarkStatus, Bookmark?) GetBookmark(int bookmarkId) {
return this.bookmarkService.GetBookmark(this.GetUserId(), bookmarkId);
}
[HttpPost]
public (BookmarkStatus, Bookmark?) CreateBookmark(string title, string url, string? notes,
int bookmarkGroupId) {
return this.bookmarkService.CreateBookmark(this.GetUserId(), title, url, notes,
bookmarkGroupId);
}
private string GetUserId() {
return this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
}
}
}