diff --git a/apps/app/src/lib/api/api.gen.ts b/apps/app/src/lib/api/api.gen.ts index a72dae2..811b62f 100644 --- a/apps/app/src/lib/api/api.gen.ts +++ b/apps/app/src/lib/api/api.gen.ts @@ -531,6 +531,17 @@ export interface components { could_make_it?: boolean | null; }; Admin: { + id?: number; + first_name?: string; + adminSince?: number; + last_name?: string; + EndId?: number; + EndElementId?: string; + Props?: { + added?: number; + }; + }; + AdminRelationship: { Id?: number; Type?: string; StartId?: number; @@ -1670,7 +1681,7 @@ export interface operations { }; content: { "application/json": { - admins?: components["schemas"]["OptimizedPersonNode"][]; + admins?: components["schemas"]["Admin"][]; }; }; }; @@ -1729,7 +1740,7 @@ export interface operations { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["Admin"]; + "application/json": components["schemas"]["AdminRelationship"]; }; }; /** @description Bad request */ @@ -1787,7 +1798,7 @@ export interface operations { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["Admin"]; + "application/json": components["schemas"]["AdminRelationship"]; }; }; /** @description Bad request */ @@ -1903,7 +1914,7 @@ export interface operations { }; content: { "application/json": { - admins?: components["schemas"]["OptimizedPersonNode"][]; + admins?: components["schemas"]["Admin"][]; }; }; }; diff --git a/apps/app/src/routes/login/google/callback/+page.server.ts b/apps/app/src/routes/login/google/callback/+page.server.ts index 3e90a5f..2f70597 100644 --- a/apps/app/src/routes/login/google/callback/+page.server.ts +++ b/apps/app/src/routes/login/google/callback/+page.server.ts @@ -12,7 +12,8 @@ import { mothers_first_name, mothers_last_name, born, - failed_to_create_user + failed_to_create_user, + biological_sex } from '$lib/paraglide/messages'; import type { PageServerLoad, Actions, RequestEvent } from './$types'; @@ -154,6 +155,20 @@ async function register(event: RequestEvent) { }) }); } + + const bbiological_sex = data.get('biological_sex'); + if (bbiological_sex === null || bbiological_sex === '') { + return fail(400, { + message: missing_field({ + field: biological_sex() + }) + }); + } else if (!['male', 'female', 'intersex', 'unknown', 'other'].includes(bbiological_sex.toString())) { + return fail(400, { + message: `Invalid value for biological_sex. Must be one of "male", "female", "intersex", "unknown", or "other".` + }); + } + const mothers_first_name_f = data.get('mothers_first_name'); if (mothers_first_name_f === null || mothers_first_name_f === '') { return fail(400, { @@ -179,6 +194,7 @@ async function register(event: RequestEvent) { born: parsed_date.toISOString().split('T')[0], mothers_first_name: mothers_first_name_f as string, mothers_last_name: mothers_last_name_f as string, + biological_sex: bbiological_sex as components['schemas']['PersonRegistration']['biological_sex'], limit: StorageLimit }; diff --git a/apps/app/src/routes/login/google/callback/+page.svelte b/apps/app/src/routes/login/google/callback/+page.svelte index 111b24e..e059ec6 100644 --- a/apps/app/src/routes/login/google/callback/+page.svelte +++ b/apps/app/src/routes/login/google/callback/+page.svelte @@ -1,5 +1,5 @@