From 07a3245bfcbf223503f736f017b9e2834dd96318 Mon Sep 17 00:00:00 2001 From: Neil Brommer Date: Mon, 13 Dec 2021 22:04:07 -0800 Subject: [PATCH] Fix create bookmark button not doing anything, fix bookmark notes not being saved --- Start/Client/Components/BookmarkGroup.razor | 2 +- Start/Server/Data/Services/BookmarkService.cs | 2 +- Start/Server/Models/Bookmark.cs | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Start/Client/Components/BookmarkGroup.razor b/Start/Client/Components/BookmarkGroup.razor index 6f32d1a..ca3b15b 100644 --- a/Start/Client/Components/BookmarkGroup.razor +++ b/Start/Client/Components/BookmarkGroup.razor @@ -51,7 +51,7 @@ @if (this.state.Value.EditMode) {
  • - diff --git a/Start/Server/Data/Services/BookmarkService.cs b/Start/Server/Data/Services/BookmarkService.cs index 078d470..0daf40a 100644 --- a/Start/Server/Data/Services/BookmarkService.cs +++ b/Start/Server/Data/Services/BookmarkService.cs @@ -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(); diff --git a/Start/Server/Models/Bookmark.cs b/Start/Server/Models/Bookmark.cs index 057d6a4..31b5fcc 100644 --- a/Start/Server/Models/Bookmark.cs +++ b/Start/Server/Models/Bookmark.cs @@ -23,14 +23,15 @@ namespace Start.Server.Models { /// The group the bookmark is in 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; } }