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/graphql/anime/resolvers.ts | |
| 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/graphql/anime/resolvers.ts')
| -rw-r--r-- | src/graphql/anime/resolvers.ts | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/graphql/anime/resolvers.ts b/src/graphql/anime/resolvers.ts index 7d04082d..5f49b364 100644 --- a/src/graphql/anime/resolvers.ts +++ b/src/graphql/anime/resolvers.ts @@ -2,21 +2,21 @@ import type { WithIndex } from '../$types'; import type { Resolvers } from './$types'; export const resolvers: WithIndex<Resolvers> = { - Query: { - Anime: async (_, args) => { - const timezone = args.timezone || 'Asia/Tokyo'; + Query: { + Anime: async (_, args) => { + const timezone = args.timezone || 'Asia/Tokyo'; - return { - subtitles: { - timezone, - schedule: Object.fromEntries( - Object.entries( - (await (await fetch(`https://subsplease.org/api/?f=schedule&tz=${timezone}`)).json()) - .schedule - ).map(([key, value]) => [key.toLowerCase(), value]) - ) - } - }; - } - } + return { + subtitles: { + timezone, + schedule: Object.fromEntries( + Object.entries( + (await (await fetch(`https://subsplease.org/api/?f=schedule&tz=${timezone}`)).json()) + .schedule + ).map(([key, value]) => [key.toLowerCase(), value]) + ) + } + }; + } + } }; |