refactored more error code

This commit is contained in:
2025-09-26 21:10:19 +02:00
parent e3b735bb7b
commit 2463f92b1c
23 changed files with 111 additions and 173 deletions

View File

@@ -3,10 +3,10 @@
import { useTinyRouter } from 'svelte-tiny-router';
import { api } from '../../urls.svelte.js';
import { error } from '../../warn.svelte';
import { t } from '../../translations.svelte.js';
let caption = t('send_mail');
let error = null;
let mail = "";
const router = useTinyRouter();
@@ -35,7 +35,7 @@
if (resp.ok){
router.navigate('/user')
} else {
error = await resp.text();
error(resp);
}
}
}
@@ -66,8 +66,5 @@
{t('enter_email')}
</label>
<button type="submit">{caption}</button>
{#if error}
<div class="error">{error}</div>
{/if}
</fieldset>
</form>