Download spectrum/api/queries/user/rootCurrentUser.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 330 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/queries/user/rootCurrentUser.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/api/queries/user/rootCurrentUser.js
-
curl -L -o rootCurrentUser.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/queries/user/rootCurrentUser.js
330 Bytes
| // @flow | |
| import type { GraphQLContext } from '../../'; | |
| import { getUserById } from 'shared/db/queries/user'; | |
| export default async (_: any, __: any, { user }: GraphQLContext) => { | |
| if (!user || !user.id) return null; | |
| const dbUser = await getUserById(user.id); | |
| if (!dbUser || dbUser.bannedAt) return null; | |
| return dbUser; | |
| }; | |