Skip to content

Commit

Permalink
feat: add userId to compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
kobakazu0429 committed Dec 13, 2023
1 parent 3009eca commit c44f919
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/compiler/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { _ } from "../i18n";
import { getUser } from "../localStorage";
import type { STATUS_CODE } from "../runners/status";
import { compileLogOut } from "../store";

Expand All @@ -15,13 +16,15 @@ type Response =
export async function compiler(src: string) {
compileLogOut(_("compiler.start"));

const userId = getUser()?.id;

const res = await (
await fetch(import.meta.env.VITE_COMPILER_API, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({ src })
body: JSON.stringify({ src, userId })
})
).json();

Expand Down

0 comments on commit c44f919

Please sign in to comment.