diff --git a/TaikoWebUI/Pages/SongList.razor b/TaikoWebUI/Pages/SongList.razor
index 40eec12..8b9f3d7 100644
--- a/TaikoWebUI/Pages/SongList.razor
+++ b/TaikoWebUI/Pages/SongList.razor
@@ -92,13 +92,13 @@
-
+
diff --git a/TaikoWebUI/Pages/SongList.razor.cs b/TaikoWebUI/Pages/SongList.razor.cs
index d750956..670294e 100644
--- a/TaikoWebUI/Pages/SongList.razor.cs
+++ b/TaikoWebUI/Pages/SongList.razor.cs
@@ -71,4 +71,19 @@ public partial class SongList
return true;
}
+
+ private async Task OnFavoriteToggled(MusicDetail data)
+ {
+ var request = new SetFavoriteRequest
+ {
+ Baid = (uint)Baid,
+ IsFavorite = !data.IsFavorite,
+ SongId = data.SongId
+ };
+ var result = await Client.PostAsJsonAsync("api/FavoriteSongs", request);
+ if (result.IsSuccessStatusCode)
+ {
+ data.IsFavorite = !data.IsFavorite;
+ }
+ }
}