Compare commits
3 Commits
f229a4ae7e
...
f8a80d7b71
Author | SHA1 | Date | |
---|---|---|---|
f8a80d7b71 | |||
d43404a80a | |||
e82b581e37 |
|
@ -22,6 +22,10 @@
|
||||||
{
|
{
|
||||||
Path: "/test2",
|
Path: "/test2",
|
||||||
Name: "test2",
|
Name: "test2",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Path: "/card",
|
||||||
|
Name: "Cards",
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
let cards: Card[] = $state([]);
|
let cards: Card[] = $state([]);
|
||||||
let error: string | null = $state(null);
|
let error: string | null = $state(null);
|
||||||
let editingCard: Card | null = $state(null);
|
let editingCard: Card | null = $state(null);
|
||||||
let newCard: Partial<Card> = {
|
let newCard: Partial<Card> = $state({
|
||||||
balance: 0,
|
balance: 0,
|
||||||
credit_line: 0,
|
credit_line: 0,
|
||||||
have_credit_line: false,
|
have_credit_line: false,
|
||||||
name: "",
|
name: "",
|
||||||
};
|
});
|
||||||
|
|
||||||
// Fetch all cards on page load
|
// Fetch all cards on page load
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
async function fetchCards() {
|
async function fetchCards() {
|
||||||
const result = await fetch("/api/card/all", { credentials: "same-origin" });
|
const result = await fetch("/api/card/all");
|
||||||
if (!result.ok) {
|
if (!result.ok) {
|
||||||
const obj = await result.json();
|
const obj = await result.json();
|
||||||
error = obj.message;
|
error = obj.message;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user