Skip to content

Commit

Permalink
🎨 format code
Browse files Browse the repository at this point in the history
  • Loading branch information
thrzl committed Jul 3, 2024
1 parent 1ef908e commit c7d9dba
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export let data;
data.pathname;
import { fade } from 'svelte/transition';
import { fade } from "svelte/transition";
</script>
<a href="/">
<div class="fixed top-5 right-5 md:top-15 md:right-15 z-999">
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ export const load = ({ url }) => {
const { pathname } = url;

return {
pathname
pathname,
};
};
6 changes: 3 additions & 3 deletions src/routes/api/finances/transactions/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export async function GET({ setHeaders }) {
);
const data = await res.json();
setHeaders({
'Cache-Control': 'max-age=43200'
});
"Cache-Control": "max-age=43200",
});

return json(data);
}
}
5 changes: 4 additions & 1 deletion src/routes/finances/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<script lang="ts">
export let data: {pathname: string, transactions: {date: string, memo: string, amount_cents: number}[]};
export let data: {
pathname: string;
transactions: { date: string; memo: string; amount_cents: number }[];
};
function formatDate(date: Date) {
return date.toLocaleDateString("en", {
Expand Down
8 changes: 4 additions & 4 deletions src/routes/finances/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ export const prerender = true;

/** @type {import('./$types').PageServerLoad} */
export function load({ fetch, setHeaders }) {
function get_data() {
return fetch("/api/finances/transactions").then((res) => res.json());
}
function get_data() {
return fetch("/api/finances/transactions").then((res) => res.json());
}

return {
transactions: get_data(),
};
}
}

0 comments on commit c7d9dba

Please sign in to comment.