diff options
Diffstat (limited to 'src/routes/api/badges/remove')
| -rw-r--r-- | src/routes/api/badges/remove/+server.ts | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/routes/api/badges/remove/+server.ts b/src/routes/api/badges/remove/+server.ts deleted file mode 100644 index 8b05369a..00000000 --- a/src/routes/api/badges/remove/+server.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { userIdentity } from '$lib/AniList/identity.js'; -import { removeUserBadge } from '$lib/userBadgesDatabase.js'; - -export const POST = async ({ url, cookies }) => { - const userCookie = cookies.get('user'); - - if (!userCookie) { - return new Response('Unauthenticated', { status: 401 }); - } - - const user = JSON.parse(userCookie); - const identity = await userIdentity({ - tokenType: user['token_type'], - expiresIn: user['expires_in'], - accessToken: user['access_token'], - refreshToken: user['refresh_token'] - }); - - removeUserBadge(identity.id, Number(url.searchParams.get('id'))); - - return Response.json({}); -}; |