aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/api')
-rw-r--r--src/routes/api/preferences/+server.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/routes/api/preferences/+server.ts b/src/routes/api/preferences/+server.ts
index 2fe2ccfe..0291dd0c 100644
--- a/src/routes/api/preferences/+server.ts
+++ b/src/routes/api/preferences/+server.ts
@@ -5,7 +5,8 @@ import {
setCSS,
setBiography,
toggleHideAWCBadges,
- togglePinnedBadgeWallCategory
+ togglePinnedBadgeWallCategory,
+ setPinnedBadgeWallCategories
} from '$lib/Database/userPreferences';
const unauthorised = new Response('Unauthorised', { status: 401 });
@@ -66,6 +67,16 @@ export const PUT = async ({ url, cookies, request }) => {
}
);
+ if (url.searchParams.get('setCategories') !== null)
+ return Response.json(
+ await setPinnedBadgeWallCategories(userId, url.searchParams.get('setCategories') || ''),
+ {
+ headers: {
+ 'Access-Control-Allow-Origin': 'https://due.moe'
+ }
+ }
+ );
+
if (url.searchParams.get('biography') !== null)
return Response.json(await setBiography(userId, (await request.text()).slice(0, 3000)), {
headers: {