Fix create bookmark button not doing anything, fix bookmark notes not being saved

This commit is contained in:
Neil Brommer 2021-12-13 22:04:07 -08:00
parent 55625b1be4
commit 07a3245bfc
3 changed files with 6 additions and 5 deletions

View file

@ -51,7 +51,7 @@
@if (this.state.Value.EditMode)
{
<li class="addBookmarkItem">
<button type="button" class="addBookmarkButton btn">
<button type="button" class="addBookmarkButton btn" @onclick="this.OnCreateBookmarkClicked">
<i class="icon icon-plus"></i>
Create Bookmark
</button>

View file

@ -32,7 +32,7 @@ namespace Start.Server.Data.Services {
if (!BookmarkOwnershipTools.IsBookmarkGroupOwner(this.db, userId, bookmarkGroupId))
return null;
Bookmark newBookmark = new(title, url, bookmarkGroupId);
Bookmark newBookmark = new(title, url, notes, bookmarkGroupId);
await db.Bookmarks.AddAsync(newBookmark);
await db.SaveChangesAsync();

View file

@ -23,14 +23,15 @@ namespace Start.Server.Models {
/// <summary>The group the bookmark is in</summary>
public BookmarkGroup? BookmarkGroup { get; set; }
public Bookmark(string title, string url, int bookmarkGroupId) {
public Bookmark(string title, string url, string? notes, int bookmarkGroupId) {
this.Title = title;
this.Url = url;
this.Notes = notes;
this.BookmarkGroupId = bookmarkGroupId;
}
public Bookmark(int bookmarkId, string title, string url, int bookmarkGroupId)
: this(title, url, bookmarkGroupId) {
public Bookmark(int bookmarkId, string title, string url, string? notes, int bookmarkGroupId)
: this(title, url, notes, bookmarkGroupId) {
this.BookmarkId = bookmarkId;
}
}