Front: Use history include to get best/last score for a song

This commit is contained in:
Arthur Jamet
2023-12-19 11:13:25 +01:00
committed by Clément Le Bihan
parent b4f04f9b71
commit 7a6dc8b0c9
7 changed files with 38 additions and 35 deletions
+3 -4
View File
@@ -21,16 +21,15 @@ import { LoadingView } from '../components/Loading';
export const FavoritesMusic = () => {
const navigation = useNavigation();
const likedSongs = useQuery(API.getLikedSongs(['artist']));
const likedSongs = useQuery(API.getLikedSongs(['artist', 'SongHistory']));
const musics =
likedSongs.data?.map((x) => ({
artist: x.song.artist!.name,
song: x.song.name,
image: x.song.cover,
level: 42,
lastScore: 42,
bestScore: 42,
lastScore: x.song.lastScore,
bestScore: x.song.bestScore,
liked: true,
onLike: () => {
console.log('onLike');