From a7816446ad71876e7076049da077568b023f5ec8 Mon Sep 17 00:00:00 2001 From: Dinis Correia <151139018+dinisjcorreia@users.noreply.github.com> Date: Wed, 27 Nov 2024 12:40:05 +0000 Subject: [PATCH] hotfix: upload cv --- .vscode/settings.json | 5 ++++- src/lib/completeAction.ts | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index b09b4e0..47bf9b0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,8 @@ "editor.formatOnSave": true, "prettier.printWidth": 160, "prettier.tabWidth": 2, - "cSpell.words": ["fallstack"] + "cSpell.words": ["fallstack"], + "[dotenv]": { + "editor.defaultFormatter": "foxundermoon.shell-format" + } } diff --git a/src/lib/completeAction.ts b/src/lib/completeAction.ts index ddab744..78bf032 100644 --- a/src/lib/completeAction.ts +++ b/src/lib/completeAction.ts @@ -9,6 +9,15 @@ export async function completeAction(studentCode: string, actionName: string) { if (!action) return null; + const alreadyCompleted = await prisma.actionCompletion.findFirst({ + where: { + studentCode, + actionId: action.id, + }, + }); + + if (alreadyCompleted) return null; + const studentAction = await prisma.actionCompletion.create({ data: { studentCode,