update album play count

This commit is contained in:
Kendall Garner
2024-09-15 21:48:32 -07:00
parent f82889e5ec
commit 96b4f8dd89
3 changed files with 39 additions and 6 deletions
+3 -3
View File
@@ -27,7 +27,7 @@ export interface EventState {
export interface EventSlice extends EventState {
actions: {
favorite: (ids: string[], favorite: boolean) => void;
play: (ids: string[]) => void;
play: (id: string) => void;
rate: (ids: string[], rating: number | null) => void;
};
}
@@ -43,10 +43,10 @@ export const useEventStore = create<EventSlice>()(
state.ids = ids;
});
},
play(ids) {
play(id) {
set((state) => {
state.event = { event: 'play', timestamp: new Date().toISOString() };
state.ids = ids;
state.ids = [id];
});
},
rate(ids, rating) {