aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api/preferences
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-04-28 23:43:57 -0700
committerFuwn <[email protected]>2024-04-28 23:43:57 -0700
commit8123a6fe99e01e93b480f036dfee262139e33ae8 (patch)
treedf8a2841c85553c5f90f072bf7f95062fbe68030 /src/routes/api/preferences
parentfeat(display): move schedule to text toggle section (diff)
downloaddue.moe-8123a6fe99e01e93b480f036dfee262139e33ae8.tar.xz
due.moe-8123a6fe99e01e93b480f036dfee262139e33ae8.zip
feat(badges): allow awc badges hiding
Diffstat (limited to 'src/routes/api/preferences')
-rw-r--r--src/routes/api/preferences/+server.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/routes/api/preferences/+server.ts b/src/routes/api/preferences/+server.ts
index 151af298..379f33c5 100644
--- a/src/routes/api/preferences/+server.ts
+++ b/src/routes/api/preferences/+server.ts
@@ -3,7 +3,8 @@ import {
getUserPreferences,
toggleHideMissingBadges,
setCSS,
- setBiography
+ setBiography,
+ toggleHideAWCBadges
} from '$lib/Database/userPreferences';
const unauthorised = new Response('Unauthorised', { status: 401 });
@@ -40,6 +41,13 @@ export const PUT = async ({ url, cookies, request }) => {
}
});
+ if (url.searchParams.get('toggleHideAWCBadges') !== null)
+ return Response.json(await toggleHideAWCBadges(userId), {
+ headers: {
+ 'Access-Control-Allow-Origin': 'https://due.moe'
+ }
+ });
+
if (url.searchParams.get('badgeWallCSS') !== null)
return Response.json(await setCSS(userId, await request.text()), {
headers: {