Download spectrum/api/queries/thread/creator.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 691 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/queries/thread/creator.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/api/queries/thread/creator.js
-
curl -L -o creator.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/queries/thread/creator.js
691 Bytes
| // @flow | |
| /* | |
| DEPRECATED 2/3/2018 by @brian | |
| */ | |
| import type { GraphQLContext } from '../../'; | |
| import type { DBThread } from 'shared/types'; | |
| export default async ( | |
| { creatorId, communityId }: DBThread, | |
| _: any, | |
| { loaders }: GraphQLContext | |
| ) => { | |
| const creator = await loaders.user.load(creatorId); | |
| const permissions = await loaders.userPermissionsInCommunity.load([ | |
| creatorId, | |
| communityId, | |
| ]); | |
| return { | |
| ...creator, | |
| contextPermissions: { | |
| communityId, | |
| isModerator: permissions ? permissions.isModerator : false, | |
| isOwner: permissions ? permissions.isOwner : false, | |
| isBlocked: permissions ? permissions.isBlocked : false, | |
| }, | |
| }; | |
| }; | |