Skip to content

Commit 06b5d27

Browse files
author
abrar-deakin
committed
Fix guard score API response
1 parent fa3098a commit 06b5d27

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

guard_app/src/api/guardScore.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ export async function getGuardScore(guardId: string): Promise<GuardScore> {
2222
}
2323

2424
try {
25-
const response = await http.get<{ success: boolean; data: GuardScore }>(
26-
`/users/guards/${guardId}/score`
27-
);
25+
const response = await http.get<{ success: boolean; data: GuardScore }>(
26+
`/users/guards/${guardId}/score`
27+
);
2828

29-
return response.data.data;
29+
return response.data.data;
3030
} catch (error) {
3131
console.log('FULL SCORE ERROR:', error);
3232

@@ -36,8 +36,7 @@ return response.data.data;
3636
}
3737

3838
throw new Error(
39-
`Failed to fetch guard score (${
40-
axios.isAxiosError(error) ? error.response?.status : 'unknown'
39+
`Failed to fetch guard score (${axios.isAxiosError(error) ? error.response?.status : 'unknown'
4140
})`,
4241
);
4342
}

0 commit comments

Comments
 (0)