preparing contact index page
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
import Bookmarks from "./routes/bookmark/Index.svelte";
|
||||
import Callback from "./routes/user/OidcCallback.svelte";
|
||||
import Companies from "./routes/company/Index.svelte";
|
||||
import ContactList from "./routes/contact/Index.svelte";
|
||||
import DocList from "./routes/document/List.svelte";
|
||||
import EditService from "./routes/user/EditService.svelte";
|
||||
import EditUser from "./routes/user/EditUser.svelte";
|
||||
@@ -81,6 +82,7 @@
|
||||
<Route path="/bookmark" component={Bookmarks} />
|
||||
<Route path="/bookmark/:id/view" component={Bookmark} />
|
||||
<Route path="/company" component={Companies} />
|
||||
<Route path="/contact" component={ContactList} />
|
||||
<Route path="/document" component={DocList} />
|
||||
<Route path="/document/add" component={AddDoc} />
|
||||
<Route path="/document/:id/send" component={SendDoc} />
|
||||
|
||||
@@ -62,6 +62,7 @@ onMount(fetchModules);
|
||||
<a href="/files" {onclick}>{t('files')}</a>
|
||||
<a href="/time" {onclick}>{t('timetracking')}</a>
|
||||
<a href="/wiki" {onclick}>{t('wiki')}</a>
|
||||
<a href="/contact" {onclick}>{t('contacts')}</a>
|
||||
{#if user.id == 2}
|
||||
<a href="https://svelte.dev/tutorial/svelte/state" target="_blank">{t('tutorial')}</a>
|
||||
{/if}
|
||||
|
||||
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