Sifa professional network API (Fastify, AT Protocol, Jetstream) sifa.id/

fix(schema): accept null location in position validation (#163)

Positions with no location set store `location: null` in the frontend.
When the skill-link toggle sends the full position back to the API,
Zod's `.optional()` rejects null (it only accepts undefined), causing
a 400 ValidationError. Add `.nullable()` to locationSchema so both
null and undefined are accepted.

authored by

Guido X Jansen and committed by
GitHub
98db46cc bddf8cb0

+2
+1
src/routes/import.ts
··· 70 70 location: 71 71 | string 72 72 | { country: string; region?: string; city?: string; countryCode?: string } 73 + | null 73 74 | undefined, 74 75 ): { country: string; region?: string; city?: string; countryCode?: string } | undefined { 75 76 if (!location) return undefined;
+1
src/routes/schemas.ts
··· 25 25 }), 26 26 z.string(), 27 27 ]) 28 + .nullable() 28 29 .optional(); 29 30 30 31 export const profileSelfSchema = z