aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-02-17 21:04:59 -0800
committerFuwn <[email protected]>2024-02-17 21:04:59 -0800
commitf1a09f3348cf4dbc7a0fb6116f9f41fcde372f4c (patch)
treebe69710d2dbf59badb9be88a1e6dce3c710d6525 /src/routes/api
parentfeat(events): avatar for all events (diff)
downloaddue.moe-f1a09f3348cf4dbc7a0fb6116f9f41fcde372f4c.tar.xz
due.moe-f1a09f3348cf4dbc7a0fb6116f9f41fcde372f4c.zip
feat(hololive): move pinned to preferences
Diffstat (limited to 'src/routes/api')
-rw-r--r--src/routes/api/preferences/+server.ts8
-rw-r--r--src/routes/api/preferences/pin/+server.ts (renamed from src/routes/api/configuration/pin/+server.ts)2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/routes/api/preferences/+server.ts b/src/routes/api/preferences/+server.ts
new file mode 100644
index 00000000..a36bd236
--- /dev/null
+++ b/src/routes/api/preferences/+server.ts
@@ -0,0 +1,8 @@
+import { getUserPreferences } from '$lib/Database/userPreferences';
+
+export const GET = async ({ url }) =>
+ Response.json(await getUserPreferences(Number(url.searchParams.get('id') || 0)), {
+ headers: {
+ 'Access-Control-Allow-Origin': 'https://due.moe'
+ }
+ });
diff --git a/src/routes/api/configuration/pin/+server.ts b/src/routes/api/preferences/pin/+server.ts
index f813d8e8..90dfce62 100644
--- a/src/routes/api/configuration/pin/+server.ts
+++ b/src/routes/api/preferences/pin/+server.ts
@@ -1,5 +1,5 @@
import { userIdentity } from '$lib/Data/AniList/identity';
-import { toggleHololiveStreamPinning } from '$lib/Database/userConfiguration';
+import { toggleHololiveStreamPinning } from '$lib/Database/userPreferences';
const unauthorised = new Response('Unauthorised', { status: 401 });