Skip to content

Commit 922b31f

Browse files
committed
chore: lint
2 minutes
1 parent 0c0f70b commit 922b31f

File tree

7 files changed

+222
-85
lines changed

7 files changed

+222
-85
lines changed

src/lib/perms/permissions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const MANAGE_TV_REQUESTS: Permission = {
6060

6161
export const MANAGE_TRAINING_PLANS: Permission = {
6262
id: "training.plans.manage",
63-
description: "Allows the user to create, edit, and delete training plans."
63+
description: "Allows the user to create, edit, and delete training plans.",
6464
};
6565

6666
export const PERMISSIONS: Permission[] = [
@@ -77,5 +77,5 @@ export const PERMISSIONS: Permission[] = [
7777
REVOKE_OPENSKIES_CERTIFICATES,
7878
MANAGE_EVENTS,
7979
MANAGE_TV_REQUESTS,
80-
MANAGE_TRAINING_PLANS
80+
MANAGE_TRAINING_PLANS,
8181
];

src/routes/[id]/events/event-card.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { Button } from "$lib/components/ui/button";
44
import * as Card from "$lib/components/ui/card";
55
import { can } from "$lib/perms/can";
6-
import { MANAGE_EVENTS, MANAGE_QUEUES } from "$lib/perms/permissions";
6+
import { MANAGE_EVENTS } from "$lib/perms/permissions";
77
import type { Event } from "@prisma/client";
88
import { PenBox, Trash2 } from "lucide-svelte";
99
import type { PageData } from "./$types";

src/routes/[id]/training/+page.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@
3131
<Card.Title>Your Training</Card.Title>
3232
</Card.Header>
3333
<Card.Content>
34-
<p>Hayya's training system is undergoing a major overhaul and has been temporarily disabled. We apologise for the inconvenience. Please check again later.</p>
34+
<p>
35+
Hayya's training system is undergoing a major overhaul and has been
36+
temporarily disabled. We apologise for the inconvenience. Please check
37+
again later.
38+
</p>
3539
</Card.Content>
3640
</Card.Root>
3741

@@ -42,7 +46,7 @@
4246
</Card.Header>
4347
<Card.Content>
4448
<Button href="/{$page.params.id}/training/plans">
45-
<CogIcon class="w-4 h-4 mr-2" />
49+
<CogIcon class="mr-2 h-4 w-4" />
4650
Manage Training Plans
4751
</Button>
4852
</Card.Content>

src/routes/[id]/training/plans/+page.server.ts

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,26 @@ import { loadUserData } from "$lib/auth";
1111
import { ulid } from "ulid";
1212
import { updateFormSchema } from "./editSchema";
1313

14-
export const load: PageServerLoad = async ({params, cookies}) => {
14+
export const load: PageServerLoad = async ({ params, cookies }) => {
1515
if (!can(MANAGE_TRAINING_PLANS)) {
16-
redirect(307, `/${params.id}`, { type: 'error', message: 'You don\'t have permission to do that.' }, cookies);
16+
redirect(
17+
307,
18+
`/${params.id}`,
19+
{ type: "error", message: "You don't have permission to do that." },
20+
cookies,
21+
);
1722
}
1823

1924
return {
2025
plans: await prisma.trainingPlan.findMany({
2126
include: {
22-
TrainingPlanRegistration: true
23-
}
27+
TrainingPlanRegistration: true,
28+
},
2429
}),
2530
createForm: await superValidate(zod(createFormSchema)),
26-
updateForm: await superValidate(zod(updateFormSchema))
27-
}
28-
}
31+
updateForm: await superValidate(zod(updateFormSchema)),
32+
};
33+
};
2934

3035
export const actions: Actions = {
3136
create: async (event) => {
@@ -49,8 +54,8 @@ export const actions: Actions = {
4954
estimatedTimeToCompleteTraining: form.data.estimatedTime,
5055
relevantPolicy: form.data.policy,
5156
hasAdjacentRestrictions: form.data.hasAdjacentRestriction,
52-
extraDetails: form.data.extraDetails
53-
}
57+
extraDetails: form.data.extraDetails,
58+
},
5459
});
5560

5661
return { form };
@@ -68,7 +73,7 @@ export const actions: Actions = {
6873

6974
await prisma.trainingPlan.update({
7075
where: {
71-
id: form.data.id
76+
id: form.data.id,
7277
},
7378
data: {
7479
facilityId: event.params.id,
@@ -78,10 +83,10 @@ export const actions: Actions = {
7883
estimatedTimeToCompleteTraining: form.data.estimatedTime,
7984
relevantPolicy: form.data.policy,
8085
hasAdjacentRestrictions: form.data.hasAdjacentRestriction,
81-
extraDetails: form.data.extraDetails
82-
}
86+
extraDetails: form.data.extraDetails,
87+
},
8388
});
8489

8590
return { form };
86-
}
87-
}
91+
},
92+
};

0 commit comments

Comments
 (0)