preparing contact index page
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
24
frontend/src/routes/contact/Index.svelte
Normal file
24
frontend/src/routes/contact/Index.svelte
Normal file
@@ -0,0 +1,24 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import { api } from '../../urls.svelte';
|
||||
import { error, yikes } from '../../warn.svelte';
|
||||
import { t } from '../../translations.svelte';
|
||||
|
||||
let contacts = $state({})
|
||||
|
||||
async function load(){
|
||||
const url = api('contact/list');
|
||||
const res = await fetch(url,{credentials:'include'});
|
||||
if (res.ok){
|
||||
yikes();
|
||||
var data = await res.json();
|
||||
console.log(data);
|
||||
} else {
|
||||
error(res);
|
||||
}
|
||||
}
|
||||
|
||||
onMount(load);
|
||||
</script>
|
||||
|
||||
<h1>{t('contacts')}</h1>
|
||||
Reference in New Issue
Block a user