generated from schreifuchs/wails-template
added export
This commit is contained in:
@ -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
|
||||
|
@ -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">
|
||||
|
2
frontend/wailsjs/go/main/App.d.ts
vendored
2
frontend/wailsjs/go/main/App.d.ts
vendored
@ -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>>;
|
||||
|
@ -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']();
|
||||
}
|
||||
|
Reference in New Issue
Block a user