added export
All checks were successful
build / windows (push) Successful in 5m34s
build / linux (push) Successful in 4m25s

This commit is contained in:
2025-03-08 11:47:54 +01:00
parent d62afd5673
commit aa5ea16e90
8 changed files with 93 additions and 21 deletions

View File

@ -1,3 +1,5 @@
## dates and their corresponding seconds been here :)
[25-03-07]
schreifuchs_at_archibald = 15333
[25-03-08]
schreifuchs_at_archibald = 1497

View File

@ -5,6 +5,7 @@
ReturnLending,
SaveLending,
DeleteLending,
ExportLendings,
} from "../../wailsjs/go/main/App";
import { model } from "../../wailsjs/go/models";
import { BrowserOpenURL } from "../../wailsjs/runtime/runtime";
@ -36,12 +37,15 @@
return true;
});
});
GetReturnedLendings().then((ls) => (returnedLendings = ls.filter((l) => {
if (clientId && l.ClientID !== clientId) {
return false;
}
return true;
})));
GetReturnedLendings().then(
(ls) =>
(returnedLendings = ls.filter((l) => {
if (clientId && l.ClientID !== clientId) {
return false;
}
return true;
})),
);
}
onMount(update);
//
@ -58,18 +62,21 @@
/>
</Modal>
<div class="m-5 grid grid-cols-5">
<div class="m-5 grid grid-cols-6 gap-5">
<Heading tag="h1" class="col-span-4">Lendings</Heading>
<Button
onclick={() => {
lending = new model.Lending();
lending.DueDate = new Date();
if (clientId) {
lending.ClientID = clientId
lending.ClientID = clientId;
}
modal = true;
}}>New</Button
>
{#if clientId !== null}
<Button onclick={() => ExportLendings(clientId)}>Export</Button>
{/if}
</div>
<section class="m-5 mb-20">

View File

@ -12,6 +12,8 @@ export function DeleteClient(arg1:model.Client):Promise<void>;
export function DeleteLending(arg1:model.Lending):Promise<void>;
export function ExportLendings(arg1:number):Promise<void>;
export function GetAllLendings():Promise<Array<model.Lending>>;
export function GetAuthors():Promise<Array<model.Author>>;

View File

@ -22,6 +22,10 @@ export function DeleteLending(arg1) {
return window['go']['main']['App']['DeleteLending'](arg1);
}
export function ExportLendings(arg1) {
return window['go']['main']['App']['ExportLendings'](arg1);
}
export function GetAllLendings() {
return window['go']['main']['App']['GetAllLendings']();
}