Fix page refresh issue
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { enhance } from '$app/forms';
|
||||
import { clientFormatPhoneNumber } from '$lib/utils';
|
||||
import type { PageProps } from './$types';
|
||||
|
||||
@@ -100,7 +101,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<form method="POST" action="?/updateProfile" class="mt-5 flex flex-col gap-4">
|
||||
<form method="POST" action="?/updateProfile" use:enhance class="mt-5 flex flex-col gap-4">
|
||||
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
||||
<div class="flex flex-col gap-1.5">
|
||||
<label for="firstName" class="text-sm font-medium text-slate-700 dark:text-slate-300">
|
||||
@@ -206,6 +207,7 @@
|
||||
<form
|
||||
method="POST"
|
||||
action={editingAddressId ? '?/updateAddress' : '?/addAddress'}
|
||||
use:enhance
|
||||
class="mt-5 flex flex-col gap-4"
|
||||
>
|
||||
{#if editingAddressId}
|
||||
@@ -314,8 +316,10 @@
|
||||
<form
|
||||
method="POST"
|
||||
action="?/deleteAddress"
|
||||
onsubmit={(event) => {
|
||||
if (!confirm('Delete this address?')) event.preventDefault();
|
||||
use:enhance={({ cancel }) => {
|
||||
if (!confirm('Delete this address?')) {
|
||||
cancel();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<input type="hidden" name="id" value={address.id} />
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
-->
|
||||
|
||||
<script lang="ts">
|
||||
import { enhance } from '$app/forms';
|
||||
import Window from '$lib/components/containers/Window.svelte';
|
||||
import { clientFormatPhoneNumber } from '$lib/utils';
|
||||
import type { PageProps } from './$types';
|
||||
@@ -42,7 +43,7 @@
|
||||
</script>
|
||||
|
||||
<Window>
|
||||
<form method="POST" class="flex flex-col items-center gap-5">
|
||||
<form method="POST" use:enhance class="flex flex-col items-center gap-5">
|
||||
<h1 class="text-center text-2xl font-bold text-slate-900 dark:text-slate-100">
|
||||
Please finish setting up your profile
|
||||
</h1>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { enhance } from '$app/forms';
|
||||
import { resolve } from '$app/paths';
|
||||
import type { PageProps } from './$types';
|
||||
import Window from '$lib/components/containers/Window.svelte';
|
||||
@@ -24,7 +25,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<form method="POST" class="flex flex-col gap-4">
|
||||
<form method="POST" use:enhance class="flex flex-col gap-4">
|
||||
<h1 class="text-2xl font-bold text-slate-900 dark:text-slate-100">Forgot Password</h1>
|
||||
<p class="text-sm text-slate-600 dark:text-slate-400">
|
||||
Enter your email and we'll send you a link to reset your password.
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
|
||||
let verified = $derived(page.url.searchParams.get('verified') === 'true');
|
||||
|
||||
async function handleSubmit() {
|
||||
async function handleSubmit(event: SubmitEvent) {
|
||||
event.preventDefault();
|
||||
const { error: authError } = await authClient.signIn.email({
|
||||
email,
|
||||
password,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { enhance } from '$app/forms';
|
||||
import Window from '$lib/components/containers/Window.svelte';
|
||||
import { authClient } from '$lib/auth-client';
|
||||
import { resolve } from '$app/paths';
|
||||
@@ -32,7 +33,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<form method="POST" class="flex flex-col gap-4">
|
||||
<form method="POST" use:enhance class="flex flex-col gap-4">
|
||||
<h1 class="text-2xl font-bold text-slate-900 dark:text-slate-100">Create Account</h1>
|
||||
|
||||
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { enhance } from '$app/forms';
|
||||
import type { PageProps } from './$types';
|
||||
import Window from '$lib/components/containers/Window.svelte';
|
||||
|
||||
@@ -15,7 +16,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<form method="POST" class="flex flex-col gap-4">
|
||||
<form method="POST" use:enhance class="flex flex-col gap-4">
|
||||
<h1 class="text-2xl font-bold text-slate-900 dark:text-slate-100">
|
||||
{data.invite ? 'Set Your Password' : 'Reset Password'}
|
||||
</h1>
|
||||
|
||||
Reference in New Issue
Block a user