working on doc forms

This commit is contained in:
2025-07-09 14:31:03 +02:00
parent 878fd21436
commit 003899f75d
3 changed files with 20 additions and 2 deletions

View File

@@ -1,11 +1,13 @@
<script>
import { useTinyRouter } from 'svelte-tiny-router';
import { onMount } from 'svelte';
import { t } from '../../translations.svelte.js';
let error = null;
let companies = {};
let documents = null;
let name = null;
let selected_company = null;
let router = useTinyRouter();
async function loadCompanies(){
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/document/companies`;
var resp = await fetch(url,{ credentials: 'include'});
@@ -18,7 +20,7 @@
}
async function load(company){
name = company.name;
selected_company = company;
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/document/list`;
const resp = await fetch(url,{
credentials: 'include',
@@ -49,6 +51,7 @@
{/each}
</div>
{#if documents}
<button onclick={() => router.navigate(`/document/add?company=${selected_company.id}`)}>{t('document.create_new')}</button>
<table>
<thead>