aboutsummaryrefslogtreecommitdiffstats
path: root/code/app/src/routes/(main)/(public)/sign-up
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-10-09 18:38:10 +0200
committerivarlovlie <git@ivarlovlie.no>2022-10-09 18:38:10 +0200
commitc0746289e8ff1c4509ea544469333baf116dbeb8 (patch)
tree1f5677342c678bf063ceb64015cdbc1d034cbcd8 /code/app/src/routes/(main)/(public)/sign-up
parent1bb31b298cab4552446aca9957f9592a34b2134f (diff)
downloadgreatoffice-c0746289e8ff1c4509ea544469333baf116dbeb8.tar.xz
greatoffice-c0746289e8ff1c4509ea544469333baf116dbeb8.zip
refactor: Update imports and clean up
Diffstat (limited to 'code/app/src/routes/(main)/(public)/sign-up')
-rw-r--r--code/app/src/routes/(main)/(public)/sign-up/+page.svelte24
1 files changed, 5 insertions, 19 deletions
diff --git a/code/app/src/routes/(main)/(public)/sign-up/+page.svelte b/code/app/src/routes/(main)/(public)/sign-up/+page.svelte
index 0dfa41a..f2f1695 100644
--- a/code/app/src/routes/(main)/(public)/sign-up/+page.svelte
+++ b/code/app/src/routes/(main)/(public)/sign-up/+page.svelte
@@ -3,8 +3,8 @@
import { create_account } from "$lib/api/user";
import { Button, Input, Alert } from "$lib/components";
import LL from "$lib/i18n/i18n-svelte";
- import type { CreateAccountPayload } from "$lib/models/CreateAccountPayload";
- import type { ErrorResult } from "$lib/models/ErrorResult";
+ import type { CreateAccountPayload } from "$lib/models/internal/CreateAccountPayload";
+ import type { ErrorResult } from "$lib/models/internal/ErrorResult";
const formData = {
username: "",
@@ -16,8 +16,7 @@
title: "",
} as ErrorResult;
let loading = false;
- $: showErrorAlert =
- (errorData?.text.length ?? 0 + errorData?.title.length ?? 0) > 0;
+ $: showErrorAlert = (errorData?.text.length ?? 0 + errorData?.title.length ?? 0) > 0;
async function submitFormAsync() {
loading = true;
@@ -49,13 +48,7 @@
<div class="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
<div class="bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10">
- <Alert
- title={errorData.title}
- message={errorData.text}
- type="error"
- class="mb-2"
- visible={showErrorAlert}
- />
+ <Alert title={errorData.title} message={errorData.text} type="error" class="mb-2" visible={showErrorAlert} />
<form class="space-y-6" on:submit|preventDefault={submitFormAsync}>
<Input
label={$LL.emailAddress()}
@@ -67,14 +60,7 @@
bind:value={formData.username}
/>
- <Input
- label={$LL.password()}
- id="password"
- name="password"
- required
- type="password"
- bind:value={formData.password}
- />
+ <Input label={$LL.password()} id="password" name="password" required type="password" bind:value={formData.password} />
<Button type="submit" text={$LL.submit()} {loading} fullWidth />
</form>
</div>