code cleanup

This commit is contained in:
2025-07-30 15:35:19 +02:00
parent 631a527a5d
commit fccec9865a
27 changed files with 442 additions and 428 deletions

View File

@@ -11,14 +11,14 @@
let error = null;
let companies = {};
let router = useTinyRouter();
let company_id = +router.query.company_id;
let documents = null;
let router = useTinyRouter();
let docType = 0;
let selected_company = null;
async function loadCompanies(){
const url = api('company/list');
const url = api('company/list');
const resp = await fetch(url,{ credentials: 'include'});
if (resp.ok){
companies = await resp.json();
@@ -40,7 +40,7 @@
async function load(company){
router.navigate(`/document?company_id=${company.id}`);
selected_company = company;
const url = api('document/list');
const url = api('document/list');
const resp = await fetch(url,{
credentials: 'include',
method: 'POST',
@@ -63,7 +63,7 @@
async function deleteDoc(ev,doc){
if (confirm(t('really_delete',doc.number))){
const url = api(`document/${doc.id}`;
const url = api(`document/${doc.id}`);
const resp = await fetch(url,{
credentials: 'include',
method: 'DELETE'