format files

This commit is contained in:
maxDorninger
2025-06-28 22:49:23 +02:00
parent a1c7b9b941
commit e44fb29852
44 changed files with 481 additions and 515 deletions

View File

@@ -1,10 +1,10 @@
<script lang="ts">
import {Button} from '$lib/components/ui/button/index.js';
import {env} from '$env/dynamic/public';
import {toast} from 'svelte-sonner';
import {Button} from '$lib/components/ui/button/index.js';
import {env} from '$env/dynamic/public';
import {toast} from 'svelte-sonner';
import * as Dialog from '$lib/components/ui/dialog/index.js';
import {Label} from '$lib/components/ui/label/index.js';
import {Input} from '$lib/components/ui/input/index.js';
import {Label} from '$lib/components/ui/label/index.js';
import {Input} from '$lib/components/ui/input/index.js';
const apiUrl = env.PUBLIC_API_URL;
let newPassword: string = $state('');
@@ -20,8 +20,8 @@
},
credentials: 'include',
body: JSON.stringify({
...(newPassword !== '' && {password: newPassword}),
...(newEmail !== '' && {password: newEmail})
...(newPassword !== '' && {password: newPassword}),
...(newEmail !== '' && {password: newEmail})
})
});
@@ -36,7 +36,7 @@
} catch (error) {
console.error('Error updating user:', error);
toast.error(
'Error updating user: ' + (error instanceof Error ? error.message : String(error))
'Error updating user: ' + (error instanceof Error ? error.message : String(error))
);
} finally {
newPassword = '';
@@ -63,22 +63,22 @@
<div>
<Label class="mb-1 block text-sm font-medium" for="email">Email</Label>
<Input
bind:value={newEmail}
class="w-full"
id="email"
placeholder="Keep empty to not change the email"
type="email"
bind:value={newEmail}
class="w-full"
id="email"
placeholder="Keep empty to not change the email"
type="email"
/>
</div>
<!-- Password -->
<div>
<Label class="mb-1 block text-sm font-medium" for="password">Password</Label>
<Input
bind:value={newPassword}
class="w-full"
id="password"
placeholder="Keep empty to not change the password"
type="password"
bind:value={newPassword}
class="w-full"
id="password"
placeholder="Keep empty to not change the password"
type="password"
/>
</div>
</div>