refactored more error code
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user