From a2e0acd6a25fcf5822a07ba867acf3eb6522664d Mon Sep 17 00:00:00 2001 From: Deluan Date: Sat, 15 Aug 2020 15:03:03 -0400 Subject: [PATCH] Fix starring albums. Seems I may have lost a commit? --- persistence/album_repository.go | 8 ++++---- ui/src/common/ContextMenus.js | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/persistence/album_repository.go b/persistence/album_repository.go index ac3df791..d930d144 100644 --- a/persistence/album_repository.go +++ b/persistence/album_repository.go @@ -319,14 +319,14 @@ func (r albumRepository) Delete(id string) error { } func (r albumRepository) Save(entity interface{}) (string, error) { - mf := entity.(*model.Artist) - id, err := r.put(mf.ID, mf) + album := entity.(*model.Album) + id, err := r.put(album.ID, album) return id, err } func (r albumRepository) Update(entity interface{}, cols ...string) error { - mf := entity.(*model.Artist) - _, err := r.put(mf.ID, mf) + album := entity.(*model.Album) + _, err := r.put(album.ID, album) return err } diff --git a/ui/src/common/ContextMenus.js b/ui/src/common/ContextMenus.js index 710f0441..a609ce69 100644 --- a/ui/src/common/ContextMenus.js +++ b/ui/src/common/ContextMenus.js @@ -136,6 +136,7 @@ const ContextMenu = ({ ) const handleToggleStar = (e) => { + e.preventDefault() toggleStarred() e.stopPropagation() } @@ -188,6 +189,7 @@ const ContextMenu = ({ export const AlbumContextMenu = (props) => ( (