Skip to content

Commit a05348a

Browse files
committed
fix(submission): bind selected language to API req
1 parent 7b3da48 commit a05348a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/components/Benchmarks/BenchmarkDetail.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const languages = [
3030
},
3131
{
3232
id: 3,
33-
name: 'c++',
33+
name: 'cpp',
3434
avatar:
3535
'https://upload.wikimedia.org/wikipedia/commons/1/18/ISO_C%2B%2B_Logo.svg',
3636
},
@@ -246,6 +246,7 @@ const BenchmarkDetail = ({
246246
code: editorRef.current.getValue(),
247247
benchmarkId:
248248
benchmarkData?.id !== undefined ? benchmarkData.id : '',
249+
language: selected.name,
249250
});
250251
}}
251252
>

src/hooks/submissions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@ function useProcessInterval({
1818
async function createJob({
1919
code,
2020
benchmarkId,
21+
language,
2122
}: {
2223
code: string;
2324
benchmarkId: string;
25+
language: string;
2426
}) {
2527
const { data } = await authenticatedRequest({
2628
url: `/submissions`,
2729
method: 'POST',
2830
data: {
29-
language: 'cpython3',
31+
language: language,
3032
code: code,
3133
benchmarkId: benchmarkId,
3234
},

0 commit comments

Comments
 (0)