Skip to content

Commit

Permalink
fix: 🐛 handle english names (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekvanox authored Dec 3, 2024
1 parent b55bf89 commit d9c3ca1
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions src/routes/(app)/positions/[id]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,28 @@ export const actions: Actions = {
const { prisma } = locals;
const form = await superValidate(request, zod(updateSchema));
if (!form.valid) return fail(400, { form });
await prisma.position.update({
where: { id: params.id },
data: {
name: form.data.name,
description: form.data.description,
email: form.data.email,
},
});
switch (languageTag()) {
case "sv":
await prisma.position.update({
where: { id: params.id },
data: {
name: form.data.name,
description: form.data.description,
email: form.data.email,
},
});
break;
case "en":
await prisma.position.update({
where: { id: params.id },
data: {
nameEn: form.data.name,
descriptionEn: form.data.description,
email: form.data.email,
},
});
break;
}
return message(form, {
message: m.positions_positionUpdated(),
type: "success",
Expand Down

0 comments on commit d9c3ca1

Please sign in to comment.