Skip to content

Commit 7e8064c

Browse files
committed
refactor(benchmarks): update useLastSubmissionForUser
1 parent 879d153 commit 7e8064c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/hooks/submissions.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,15 @@ export function useLastSubmissionForUser(
107107
`last-submission-${benchmarkId}-${language}`,
108108
async () => {
109109
if (benchmarkId && language) {
110-
const { data } = await axios.put(
111-
`${process.env.REACT_APP_API_ENDPOINT}/submissions`,
112-
{
113-
benchmarkId,
114-
language,
115-
},
110+
const { data } = await axios.get(
111+
`${process.env.REACT_APP_API_ENDPOINT}/benchmarks/${benchmarkId}/submissions/last`,
116112
{
117113
headers: {
118114
Authorization: `Bearer ${token}`,
119115
},
116+
params: {
117+
language,
118+
},
120119
},
121120
);
122121
return data;

0 commit comments

Comments
 (0)