Compare commits

...

2 Commits

Author SHA1 Message Date
0a513d2350 do not allow sign in if team member is blocked
All checks were successful
deploy / build-and-deploy (/testvaro, /opt/website-test, website-test) (push) Successful in 14s
deploy / build-and-deploy (/varo, /opt/website, website) (push) Successful in 14s
2025-06-10 11:50:52 +02:00
057a287277 fix admin dashboard team edit 2025-06-10 11:50:32 +02:00
2 changed files with 13 additions and 3 deletions

View File

@ -66,8 +66,9 @@ export const signup = {
}); });
} }
let memberUuid;
try { try {
await getJavaUuid(input.teamMember); memberUuid = await getJavaUuid(input.teamMember);
} catch (_) { } catch (_) {
throw new ActionError({ throw new ActionError({
code: 'NOT_FOUND', code: 'NOT_FOUND',
@ -85,6 +86,15 @@ export const signup = {
}); });
} }
} }
if (memberUuid) {
const blockedUser = await db.getBlockedUserByUuid({ uuid: memberUuid });
if (blockedUser) {
throw new ActionError({
code: 'FORBIDDEN',
message: 'Dein Mitspieler ist für die Registrierung gesperrt. Bitte suche dir einen anderen Mitspieler'
});
}
}
if (!teamDraft) { if (!teamDraft) {
// check if a team with the same name already exists // check if a team with the same name already exists

View File

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { deleteTeam, type Team, teams } from '@app/admin/teams/teams.ts'; import { deleteTeam, editTeam, type Team, teams } from '@app/admin/teams/teams.ts';
import DataTable from '@components/admin/table/DataTable.svelte'; import DataTable from '@components/admin/table/DataTable.svelte';
import CrudPopup from '@components/admin/popup/CrudPopup.svelte'; import CrudPopup from '@components/admin/popup/CrudPopup.svelte';
import { confirmPopupState } from '@components/popup/ConfirmPopup.ts'; import { confirmPopupState } from '@components/popup/ConfirmPopup.ts';
@ -82,6 +82,6 @@
} }
] ]
]} ]}
onSubmit={deleteTeam} onSubmit={editTeam}
bind:open={editPopupOpen} bind:open={editPopupOpen}
/> />