Add "active" switches on data/season drivers page

This commit is contained in:
2024-12-15 21:44:27 +01:00
parent 38aa6e8326
commit ee24f0fd99
3 changed files with 24 additions and 4 deletions

View File

@ -59,6 +59,9 @@ export const actions = {
const data: FormData = form_data_clean(await request.formData());
const id: string = form_data_get_and_remove_id(data);
// The toggle switch will report "on" or nothing
data.set("active", data.has("active") ? "true" : "false");
await locals.pb.collection("drivers").update(id, data);
return { tab: 1 };