Skip to content

Commit 662608a

Browse files
committed
Fix report dropdown options
1 parent 506ffac commit 662608a

File tree

3 files changed

+16
-32
lines changed

3 files changed

+16
-32
lines changed

Site/src/routes/(legal)/report/+page.server.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,10 @@ import ratelimit from "$lib/server/ratelimit"
88
import { db, Record, type RecordId } from "$lib/server/surreal"
99
import getReporteeQuery from "./getReportee.surql"
1010
import reportQuery from "./report.surql"
11+
import reports from "./reports"
1112

1213
const schema = type({
13-
category: type
14-
.enumerated(
15-
"AccountTheft",
16-
"Dating",
17-
"Exploiting",
18-
"Harassment",
19-
"InappropriateContent",
20-
"PersonalInformation",
21-
"Scamming",
22-
"Spam",
23-
"Swearing",
24-
"Threats",
25-
"Under13"
26-
)
27-
.describe("a valid report category"),
14+
category: type.enumerated(...reports).describe("a valid report category"),
2815
note: "string | undefined",
2916
})
3017

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

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,12 @@
44
import Select from "$components/forms/Select.svelte"
55
import Textarea from "$components/forms/Textarea.svelte"
66
import Head from "$components/Head.svelte"
7+
import reports from "./reports"
78
89
const { data } = $props()
910
1011
const formData = superForm(data.form)
1112
export const snapshot = formData
12-
13-
const reports: [string, string][] = [
14-
["AccountTheft", "Account theft"],
15-
["Dating", "Dating"],
16-
["Exploiting", "Exploiting"],
17-
["Harassment", "Harassment or discrimination"],
18-
["InappropriateContent", "Inappropriate content"],
19-
[
20-
"PersonalInformation",
21-
"Personal information (displaying their own or asking for others')"
22-
],
23-
["Scamming", "Scamming"],
24-
["Under13", "Suspected under 13 user"],
25-
["Spam", "Spam"],
26-
["Swearing", "Swearing"],
27-
["Threats", "Threats"]
28-
]
2913
</script>
3014

3115
<Head name={data.siteName} title="Report {data.reportee}" />
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export default Object.freeze([
2+
"Account theft",
3+
"Dating",
4+
"Exploiting",
5+
"Harassment or discrimination",
6+
"Inappropriate content",
7+
"Personal information (displaying their own or asking for others')",
8+
"Scamming",
9+
"Suspected under 13 user",
10+
"Spam",
11+
"Swearing",
12+
"Threats",
13+
] as const)

0 commit comments

Comments
 (0)