Fix create bookmark button not doing anything, fix bookmark notes not being saved
This commit is contained in:
parent
55625b1be4
commit
07a3245bfc
|
@ -51,7 +51,7 @@
|
||||||
@if (this.state.Value.EditMode)
|
@if (this.state.Value.EditMode)
|
||||||
{
|
{
|
||||||
<li class="addBookmarkItem">
|
<li class="addBookmarkItem">
|
||||||
<button type="button" class="addBookmarkButton btn">
|
<button type="button" class="addBookmarkButton btn" @onclick="this.OnCreateBookmarkClicked">
|
||||||
<i class="icon icon-plus"></i>
|
<i class="icon icon-plus"></i>
|
||||||
Create Bookmark
|
Create Bookmark
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace Start.Server.Data.Services {
|
||||||
if (!BookmarkOwnershipTools.IsBookmarkGroupOwner(this.db, userId, bookmarkGroupId))
|
if (!BookmarkOwnershipTools.IsBookmarkGroupOwner(this.db, userId, bookmarkGroupId))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
Bookmark newBookmark = new(title, url, bookmarkGroupId);
|
Bookmark newBookmark = new(title, url, notes, bookmarkGroupId);
|
||||||
|
|
||||||
await db.Bookmarks.AddAsync(newBookmark);
|
await db.Bookmarks.AddAsync(newBookmark);
|
||||||
await db.SaveChangesAsync();
|
await db.SaveChangesAsync();
|
||||||
|
|
|
@ -23,14 +23,15 @@ namespace Start.Server.Models {
|
||||||
/// <summary>The group the bookmark is in</summary>
|
/// <summary>The group the bookmark is in</summary>
|
||||||
public BookmarkGroup? BookmarkGroup { get; set; }
|
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.Title = title;
|
||||||
this.Url = url;
|
this.Url = url;
|
||||||
|
this.Notes = notes;
|
||||||
this.BookmarkGroupId = bookmarkGroupId;
|
this.BookmarkGroupId = bookmarkGroupId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bookmark(int bookmarkId, string title, string url, int bookmarkGroupId)
|
public Bookmark(int bookmarkId, string title, string url, string? notes, int bookmarkGroupId)
|
||||||
: this(title, url, bookmarkGroupId) {
|
: this(title, url, notes, bookmarkGroupId) {
|
||||||
this.BookmarkId = bookmarkId;
|
this.BookmarkId = bookmarkId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue