fix: sanitize API error text display and add time_blockers tests
Add extractErrorMessage helper for JSON error body parsing and apply sanitizeText across all toast displays. Add time_blockers test coverage for new holiday placeholder cleanup and overlapping scenarios.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { SvelteDate, SvelteMap } from 'svelte/reactivity';
|
||||
import { CalendarDate, getLocalTimeZone, type DateValue } from '@internationalized/date';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { extractErrorMessage } from '$lib/utils/toast-safe';
|
||||
import * as Modal from '$lib/components/ui/dialog';
|
||||
import { Button } from '$lib/components/ui/button';
|
||||
import * as Textarea from '$lib/components/ui/textarea';
|
||||
@@ -724,7 +725,7 @@
|
||||
onSubmitted();
|
||||
} else {
|
||||
const text = await response.text();
|
||||
toast.error(text || 'Failed to submit edit/reschedule request');
|
||||
toast.error(extractErrorMessage(text) || 'Failed to submit edit/reschedule request');
|
||||
}
|
||||
} catch {
|
||||
toast.error('Network error');
|
||||
|
||||
Reference in New Issue
Block a user