From 5efc9113e1d607d0b7f0350077fd26aecd2f2130 Mon Sep 17 00:00:00 2001 From: MahitGtg Date: Mon, 13 Jan 2025 16:08:46 +0000 Subject: [PATCH] fixed ts errors --- client/src/views/LeaderboardView.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/views/LeaderboardView.vue b/client/src/views/LeaderboardView.vue index 3510eda..aa6b720 100644 --- a/client/src/views/LeaderboardView.vue +++ b/client/src/views/LeaderboardView.vue @@ -5,6 +5,7 @@ import { ref, onMounted } from 'vue' import { useUserStore } from '@/stores/user' import server from '@/utils/server' +// These interfaces should match exactly what we're working with interface LeaderboardApiEntry { username: string total_points: number @@ -17,6 +18,7 @@ interface LeaderboardEntry { avatarIndex: number name: string points: number + isHighlighted: boolean } const userStore = useUserStore() @@ -28,7 +30,7 @@ const error = ref(null) const fetchLeaderboard = async () => { try { isLoading.value = true - const response = await server.get('/leaderboard/', { + const response = await server.get('/leaderboard/', { headers: { Accept: 'application/json', 'Content-Type': 'application/json', @@ -37,7 +39,10 @@ const fetchLeaderboard = async () => { const data: LeaderboardApiEntry[] = response.data - const transformEntry = (entry: LeaderboardApiEntry, highlight: boolean = false) => ({ + const transformEntry = ( + entry: LeaderboardApiEntry, + highlight: boolean = false, + ): LeaderboardEntry => ({ rank: entry.rank, avatarIndex: entry.avatar, name: entry.username,