Fix settings validation and session errors

This commit is contained in:
gpt-engineer-app[bot]
2025-10-14 23:48:34 +00:00
parent 439a7f4abf
commit 21d16f01ed
5 changed files with 62 additions and 29 deletions

View File

@@ -18,17 +18,18 @@ import { z } from 'zod';
/**
* Schema for privacy settings in user_preferences
* Uses defaults for backward compatibility with incomplete data
*/
export const privacySettingsSchema = z.object({
activity_visibility: z.enum(['public', 'private'] as const),
search_visibility: z.boolean(),
show_location: z.boolean(),
show_age: z.boolean(),
show_avatar: z.boolean(),
show_bio: z.boolean(),
show_activity_stats: z.boolean(),
show_home_park: z.boolean()
});
activity_visibility: z.enum(['public', 'private'] as const).default('public'),
search_visibility: z.boolean().default(true),
show_location: z.boolean().default(false),
show_age: z.boolean().default(false),
show_avatar: z.boolean().default(true),
show_bio: z.boolean().default(true),
show_activity_stats: z.boolean().default(true),
show_home_park: z.boolean().default(false)
}).passthrough();
/**
* Schema for profile privacy settings