working on doc forms
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user