implemented opening and closing of projects right from the project list
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
let companies = $state(null);
|
||||
let value = 0;
|
||||
|
||||
let sortedCompanies = $derived.by(() => Object.values(companies).sort((a, b) => a.name.localeCompare(b.name)));
|
||||
|
||||
async function loadCompanies(){
|
||||
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/company/list`;
|
||||
var resp = await fetch(url,{ credentials: 'include'});
|
||||
@@ -27,8 +29,8 @@
|
||||
{#if companies}
|
||||
<select onchange={select} bind:value>
|
||||
<option value={0}>{caption}</option>
|
||||
{#each companies as company,idx}
|
||||
<option value={idx}>{company.name}</option>
|
||||
{#each sortedCompanies as company}
|
||||
<option value={company.id}>{company.name}</option>
|
||||
{/each}
|
||||
</select>
|
||||
{:else}
|
||||
|
||||
Reference in New Issue
Block a user