diff --git a/server/api/calendars/create.post.ts b/server/api/calendars/create.post.ts index bacd4b9..b6f90b6 100644 --- a/server/api/calendars/create.post.ts +++ b/server/api/calendars/create.post.ts @@ -1,5 +1,4 @@ import { serverSupabaseClient } from "#supabase/server"; -// import type { Calendar} from "~/models/CalendarConfig"; import type { Calendar} from "~/models/CalendarConfig"; import { postCalendarSchema } from "~/models/CalendarConfig"; @@ -63,7 +62,7 @@ export default defineEventHandler(async (event) => { .insert(bodyData.months as never) if (error) throw error - } catch (err) { + } catch { // If we found an error, rollback the calendar if (calendarId) { await client @@ -89,7 +88,7 @@ export default defineEventHandler(async (event) => { .eq("id", calendarId) .limit(1) .single() - } catch (err) { + } catch { throw createError({ cause: "Serveur", fatal: false, diff --git a/server/api/worlds/create.post.ts b/server/api/worlds/create.post.ts index 8591d3d..ad57f8f 100644 --- a/server/api/worlds/create.post.ts +++ b/server/api/worlds/create.post.ts @@ -1,5 +1,4 @@ import { serverSupabaseClient } from "#supabase/server"; -// import type { Calendar} from "~/models/CalendarConfig"; import type { World } from "~/models/World"; import { postWorldSchema } from "~/models/World"; @@ -41,7 +40,7 @@ export default defineEventHandler(async (event) => { if (error) throw error return data - } catch (err) { + } catch { throw createError({ cause: "Serveur", status: 500,