feat(frontend): update admin components
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { authStore } from '$lib/stores/auth.svelte';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { sanitizeText } from '$lib/utils/toast-safe';
|
||||
import { Button } from '$lib/components/ui/button';
|
||||
import * as Card from '$lib/components/ui/card';
|
||||
import { Input } from '$lib/components/ui/input';
|
||||
@@ -154,7 +155,7 @@
|
||||
await fetchServices();
|
||||
} else {
|
||||
const err = await response.text();
|
||||
toast.error(`Failed: ${err}`);
|
||||
toast.error('Failed: ' + sanitizeText(err));
|
||||
}
|
||||
} catch {
|
||||
toast.error('Network error');
|
||||
@@ -177,7 +178,8 @@
|
||||
} else if (response.status === 409) {
|
||||
toast.error('A service with this name already exists');
|
||||
} else {
|
||||
toast.error(`Failed: ${await response.text()}`);
|
||||
const errText = await response.text();
|
||||
toast.error('Failed: ' + sanitizeText(errText));
|
||||
}
|
||||
} catch {
|
||||
toast.error('Network error');
|
||||
@@ -197,7 +199,8 @@
|
||||
} else if (response.status === 409) {
|
||||
toast.error('Cannot delete: used in bookings. Promote first.');
|
||||
} else {
|
||||
toast.error(`Failed: ${await response.text()}`);
|
||||
const errText = await response.text();
|
||||
toast.error('Failed: ' + sanitizeText(errText));
|
||||
}
|
||||
} catch {
|
||||
toast.error('Network error');
|
||||
|
||||
Reference in New Issue
Block a user