Config and housekeeping cleanup
- .gitignore: add coverage/, .vscode/, .idea/ - .env.example files: add header comments clarifying production vs dev, add SMTP vars to server dev template - Validate SavedView filters on load with safeParse fallback Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import type { CreateTicketInput, UpdateTicketInput } from '../../../shared/schem
|
||||
import type { CreateUserInput, UpdateUserInput } from '../../../shared/schemas/user';
|
||||
import type { UpdateWebhookInput } from '../../../shared/schemas/notification';
|
||||
import type { CreateSavedViewInput } from '../../../shared/schemas/savedView';
|
||||
import { savedViewFiltersSchema } from '../../../shared/schemas/savedView';
|
||||
|
||||
// ── Keys ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -378,7 +379,13 @@ export function useRotateWebhookSecret() {
|
||||
export function useSavedViews() {
|
||||
return useQuery({
|
||||
queryKey: qk.savedViews(),
|
||||
queryFn: async () => (await api.get<SavedView[]>('/saved-views')).data,
|
||||
queryFn: async () => {
|
||||
const views = (await api.get<SavedView[]>('/saved-views')).data;
|
||||
return views.map((v) => ({
|
||||
...v,
|
||||
filters: savedViewFiltersSchema.catch({}).parse(v.filters),
|
||||
}));
|
||||
},
|
||||
staleTime: 60_000,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user