Skip to content

Commit b95c9c8

Browse files
authored
Merge branch 'catalogfixes' into main
2 parents 50971c5 + c4ee55c commit b95c9c8

File tree

35 files changed

+319
-106
lines changed

35 files changed

+319
-106
lines changed

Site/bun.lock

Lines changed: 6 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Site/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"type": "module",
2626
"dependencies": {
2727
"@sveltejs/adapter-node": "^5.4.0",
28-
"@sveltejs/kit": "~2.42.2",
28+
"@sveltejs/kit": "^2.49.1",
2929
"@sveltejs/vite-plugin-svelte": "^6.2.1",
3030
"@unocss/extractor-svelte": "^66.5.10",
3131
"@unocss/preset-tagify": "^66.5.10",

Site/src/components/CommentLike.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class?: ClassValue
1616
} = $props()
1717
18-
const smallClass = small ? "size-6 p-0" : "p-1"
18+
let smallClass = $derived(small ? "size-6 p-0" : "p-1")
1919
</script>
2020

2121
<form

Site/src/components/DeleteButton.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
moderate?: boolean
1111
} = $props()
1212
13-
const text = moderate ? "remove" : "delete"
13+
let text = $derived(moderate ? "remove" : "delete")
1414
</script>
1515

1616
<li class="rounded-2">

Site/src/components/Transaction.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
currencySymbol: string
1313
} = $props()
1414
15-
const [, c1, c2] = beautifyCurrency(transaction.Amount)
15+
let [, c1, c2] = $derived(beautifyCurrency(transaction.Amount))
1616
</script>
1717

1818
<td>

Site/src/lib/server/init.surql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ DEFINE TABLE OVERWRITE asset SCHEMAFULL;
55
DEFINE FIELD OVERWRITE id ON asset TYPE int;
66
DEFINE FIELD OVERWRITE created ON asset TYPE datetime DEFAULT time::now();
77
DEFINE FIELD OVERWRITE description ON asset FLEXIBLE TYPE array DEFAULT ALWAYS [];
8+
DEFINE FIELD OVERWRITE forSale ON asset TYPE bool DEFAULT true;
89
DEFINE FIELD OVERWRITE name ON asset TYPE string;
910
DEFINE FIELD OVERWRITE price ON asset TYPE int DEFAULT 0;
1011
DEFINE FIELD OVERWRITE type ON asset TYPE int;
@@ -147,6 +148,8 @@ DEFINE TABLE OVERWRITE session SCHEMAFULL;
147148
DEFINE FIELD OVERWRITE created ON session TYPE datetime DEFAULT time::now();
148149
DEFINE FIELD OVERWRITE expires ON session TYPE datetime DEFAULT time::now() + 30d;
149150

151+
# the awesomest table in Mercury Core
152+
# What's in it? Nobody knooooowssssssss
150153
DEFINE TABLE OVERWRITE stuff SCHEMALESS;
151154

152155
DEFINE TABLE OVERWRITE user SCHEMAFULL;

Site/src/routes/(legal)/moderation/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Ban: "Ban",
1010
Termination: "Termination"
1111
}
12-
const actionType = moderationAction[data.type]
12+
let actionType = $derived(moderationAction[data.type])
1313
1414
const s = (n: number) => (n > 1 ? "s" : "")
1515
function formatDateDiff(date: number) {

Site/src/routes/(legal)/statistics/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
44
const { data } = $props()
55
6-
const [
6+
let [
77
users,
88
places,
99
groups,
1010
assets,
1111
friendships,
1212
followerships,
1313
comments
14-
] = data.stats
14+
] = $derived(data.stats)
1515
</script>
1616

1717
<Head name={data.siteName} title="Statistics" />

Site/src/routes/(main)/admin/create/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
1313
const { data } = $props()
1414
15-
const formDataManual = superForm(data.form)
15+
let formDataManual = $derived(superForm(data.form))
1616
1717
let tabData = $state(
1818
TabData(data.url, ["Asset creation"], ["fa-file-circle-plus"])

Site/src/routes/(main)/catalog/+page.server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ export type Asset = {
66
name: string
77
price: number
88
id: number
9-
type: number
109
}
1110

1211
export async function load({ url }) {
1312
const { page, checkPages } = pageQuery(url)
13+
// const type = url.searchParams.get("type") || ""
14+
// if (!intRegex.test(type)) error(400, "Invalid type parameter")
1415

15-
const [assets, pages] = await db.query<[Asset[], number]>(catalogQuery, {
16+
const [, pages] = await db.query<[Asset[], number]>(catalogQuery, {
1617
page,
18+
// type: +type,
1719
})
1820
checkPages(pages)
19-
20-
return { assets, pages }
2121
}

0 commit comments

Comments
 (0)