diff options
| author | Fuwn <[email protected]> | 2024-10-09 00:41:20 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-09 00:41:43 -0700 |
| commit | 998b63a35256ac985a5a2714dd1ca451af4dfd8a (patch) | |
| tree | 50796121a9d5ab0330fdc5d7e098bda2860d9726 /src/routes/api/preferences/pin | |
| parent | feat(graphql): add badgeCount field (diff) | |
| download | due.moe-998b63a35256ac985a5a2714dd1ca451af4dfd8a.tar.xz due.moe-998b63a35256ac985a5a2714dd1ca451af4dfd8a.zip | |
chore(prettier): use spaces instead of tabs
Diffstat (limited to 'src/routes/api/preferences/pin')
| -rw-r--r-- | src/routes/api/preferences/pin/+server.ts | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/routes/api/preferences/pin/+server.ts b/src/routes/api/preferences/pin/+server.ts index 73c4d5de..28398cf0 100644 --- a/src/routes/api/preferences/pin/+server.ts +++ b/src/routes/api/preferences/pin/+server.ts @@ -4,29 +4,29 @@ import { toggleHololiveStreamPinning } from '$lib/Database/SB/User/preferences'; const unauthorised = new Response('Unauthorised', { status: 401 }); export const PUT = async ({ cookies, url }) => { - const userCookie = cookies.get('user'); + const userCookie = cookies.get('user'); - if (!userCookie) return unauthorised; + if (!userCookie) return unauthorised; - const user = JSON.parse(userCookie); + const user = JSON.parse(userCookie); - return Response.json( - await toggleHololiveStreamPinning( - ( - await userIdentity({ - tokenType: user['token_type'], - expiresIn: user['expires_in'], - accessToken: user['access_token'], - refreshToken: user['refresh_token'] - }) - ).id, - url.searchParams.get('stream') || '' - ), - { - headers: { - method: 'PUT', - 'Access-Control-Allow-Origin': 'https://due.moe' - } - } - ); + return Response.json( + await toggleHololiveStreamPinning( + ( + await userIdentity({ + tokenType: user['token_type'], + expiresIn: user['expires_in'], + accessToken: user['access_token'], + refreshToken: user['refresh_token'] + }) + ).id, + url.searchParams.get('stream') || '' + ), + { + headers: { + method: 'PUT', + 'Access-Control-Allow-Origin': 'https://due.moe' + } + } + ); }; |