-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove stores.ts and call categories from layout
- Loading branch information
Showing
8 changed files
with
136 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
xmlns:xlink="http://www.w3.org/1999/xlink" | ||
version="1.1" | ||
width="1em" | ||
height="1em" | ||
viewBox="0 0 256 256" | ||
xml:space="preserve" | ||
> | ||
<defs /> | ||
<g | ||
style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;" | ||
transform="translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)" | ||
> | ||
<path | ||
d="M 73.178 87.033 H 16.822 c -0.82 0 -1.484 0.664 -1.484 1.484 c 0 0.819 0.664 1.484 1.484 1.484 h 56.357 c 0.819 0 1.484 -0.664 1.484 -1.484 C 74.662 87.697 73.997 87.033 73.178 87.033 z" | ||
style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" | ||
transform=" matrix(1 0 0 1 0 0) " | ||
stroke-linecap="round" | ||
/> | ||
<path | ||
d="M 44.039 77.043 c 0.016 0.014 0.037 0.018 0.054 0.031 c 0.089 0.069 0.18 0.137 0.285 0.185 c 0.025 0.012 0.052 0.016 0.078 0.026 c 0.031 0.012 0.062 0.021 0.093 0.031 c 0.148 0.047 0.299 0.08 0.45 0.08 c 0 0 0 0 0 0 c 0 0 0 0 0 0 c 0.152 0 0.302 -0.032 0.45 -0.079 c 0.032 -0.01 0.063 -0.019 0.095 -0.032 c 0.025 -0.01 0.052 -0.014 0.077 -0.026 c 0.104 -0.048 0.195 -0.115 0.283 -0.184 c 0.017 -0.014 0.039 -0.018 0.056 -0.033 l 28.178 -23.97 c 0.624 -0.531 0.7 -1.467 0.169 -2.091 c -0.531 -0.623 -1.467 -0.699 -2.091 -0.169 L 46.484 72.704 V 1.484 C 46.484 0.664 45.819 0 45 0 c -0.82 0 -1.484 0.664 -1.484 1.484 v 71.22 L 17.783 50.813 c -0.624 -0.531 -1.56 -0.455 -2.091 0.169 c -0.531 0.624 -0.455 1.56 0.169 2.091 L 44.039 77.043 z" | ||
style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" | ||
transform=" matrix(1 0 0 1 0 0) " | ||
stroke-linecap="round" | ||
/> | ||
</g> | ||
</svg> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,35 @@ | ||
|
||
export const ssr = true; | ||
export const csr = true; | ||
|
||
export interface Categories { | ||
mycats: any; | ||
status?: number; | ||
error?: string; | ||
} | ||
|
||
/** @type {import('./$types').PageServerLoad} */ | ||
export async function load(): Promise<Categories> { | ||
console.log(`stores load categories start`); | ||
try { | ||
|
||
const res = await fetch(`http://localhost:8000/api/categories`); | ||
|
||
if (!res.ok) { | ||
throw new Error(`Failed to fetch categories with status ${res.status}`); | ||
} | ||
|
||
const categories = await res.json(); | ||
|
||
console.log(`stores loaded categories with len: ${Object.keys(categories).length}`); | ||
return { mycats: categories }; | ||
|
||
} catch (error) { | ||
console.error('Failed to load data:', error); | ||
return { | ||
mycats: null, | ||
status: 500, | ||
error: 'Failed to load categories' | ||
}; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.