From 998b63a35256ac985a5a2714dd1ca451af4dfd8a Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 9 Oct 2024 00:41:20 -0700 Subject: chore(prettier): use spaces instead of tabs --- src/graphql/user/resolvers.ts | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'src/graphql/user/resolvers.ts') diff --git a/src/graphql/user/resolvers.ts b/src/graphql/user/resolvers.ts index 9bccbd6b..4609108a 100644 --- a/src/graphql/user/resolvers.ts +++ b/src/graphql/user/resolvers.ts @@ -12,7 +12,17 @@ import type { WithIndex } from '../$types'; import type { Resolvers, Badge } from './$types'; import authorisedJson from '$lib/Data/Static/authorised.json'; import type { RequestEvent } from '@sveltejs/kit'; -import { getUserPreferences, setBiography, setCSS, setPinnedBadgeWallCategories, toggleHideAWCBadges, toggleHideMissingBadges, toggleHololiveStreamPinning, togglePinnedBadgeWallCategory, type UserPreferences } from '$lib/Database/SB/User/preferences'; +import { + getUserPreferences, + setBiography, + setCSS, + setPinnedBadgeWallCategories, + toggleHideAWCBadges, + toggleHideMissingBadges, + toggleHololiveStreamPinning, + togglePinnedBadgeWallCategory, + type UserPreferences +} from '$lib/Database/SB/User/preferences'; type Context = RequestEvent>, string | null>; @@ -43,14 +53,14 @@ const authenticatedBadgesOperation = async ( await operation(identity, authorised); - const badges = await getUserBadges(identity.id) + const badges = await getUserBadges(identity.id); return { id: identity.id, badges, preferences: {}, badgesCount: badges.length - } + }; }; const authenticatedPreferencesOperation = async ( @@ -68,7 +78,7 @@ const authenticatedPreferencesOperation = async ( badges: [] as Badge[], preferences: await operation(identity, authorised), badgesCount: 0 - } + }; }; export const resolvers: WithIndex = { @@ -76,7 +86,7 @@ export const resolvers: WithIndex = { User: async (_, args) => { if (!args.id) return null; - const badges = (await getUserBadges(args.id)) + const badges = await getUserBadges(args.id); return { id: args.id, @@ -95,8 +105,7 @@ export const resolvers: WithIndex = { shadowHideBadge: async (_, args, context) => await authenticatedBadgesOperation( context, - async () => - await setShadowHiddenBadge(args.id, args.state == null ? true : args.state) + async () => await setShadowHiddenBadge(args.id, args.state == null ? true : args.state) ), hideBadge: async (_, args, context) => await authenticatedBadgesOperation(context, async (identity) => { @@ -113,7 +122,7 @@ export const resolvers: WithIndex = { allBadges .filter((badge) => badge.category === category) .filter((badge) => badge.hidden).length > - allBadges.filter((badge) => badge.category === category).length / 2 + allBadges.filter((badge) => badge.category === category).length / 2 ? false : true }); @@ -178,12 +187,11 @@ export const resolvers: WithIndex = { await authenticatedPreferencesOperation( context as Context, async (identity) => await setBiography(identity.id, args.biography.slice(0, 3000)) - ) - , + ), togglePinnedHololiveStream: async (_, args, context) => await authenticatedPreferencesOperation( context as Context, async (identity) => await toggleHololiveStreamPinning(identity.id, args.stream) - ), + ) } }; -- cgit v1.2.3