freactoring to get company list work in efficient way

This commit is contained in:
2025-07-18 23:23:14 +02:00
parent 722f12912d
commit a06217517b
22 changed files with 203 additions and 76 deletions

View File

@@ -20,13 +20,11 @@
});
async function loadCompanies(){
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/document/companies`;
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/company/list`;
var resp = await fetch(url,{ credentials: 'include'});
if (resp.ok){
const companies = await resp.json();
for (let c of companies) {
if (c.id == document.sender.company) company = c;
}
company = companies[document.sender.company];
document.sender.name = '';
if (company.name) document.sender.name += company.name+"\n";
if (company.address) document.sender.name += company.address+"\n";

View File

@@ -15,7 +15,7 @@
let docType = 0;
async function loadCompanies(){
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/document/companies`;
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/company/list`;
var resp = await fetch(url,{ credentials: 'include'});
if (resp.ok){
companies = await resp.json();