Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
// @flow
import type { DBChannel } from 'shared/types';
import type { GraphQLContext } from '../../';
import { canModerateChannel } from '../../utils/permissions';
export default async ({ id }: DBChannel, _: any, ctx: GraphQLContext) => {
const { user: currentUser, loaders } = ctx;
if (!currentUser) return null;
if (!(await canModerateChannel(currentUser.id, id, loaders))) {
return null;
}
return loaders.channelSettings.load(id).then(settings => {
return settings.joinSettings;
});
};