diff options
| author | Fuwn <[email protected]> | 2024-02-17 21:04:59 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-02-17 21:04:59 -0800 |
| commit | f1a09f3348cf4dbc7a0fb6116f9f41fcde372f4c (patch) | |
| tree | be69710d2dbf59badb9be88a1e6dce3c710d6525 /src/routes/api | |
| parent | feat(events): avatar for all events (diff) | |
| download | due.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.ts | 8 | ||||
| -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 }); |