Skip to content

Commit

Permalink
🎨 folderResolver typescript fix
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacInsoll committed Aug 5, 2024
1 parent 2da1b4b commit 3d26a2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 3 additions & 2 deletions backend/graphql/resolvers/folderResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Folder } from '../../../graphql-types';
import { GraphQLFieldResolver } from 'graphql/type';
import { IncomingCustomHeaders } from '../../types/incomingCustomHeaders';
import { doAuthError } from '../../auth/doAuthError';
import { Folder as GqlFolder } from '../../../graphql-types';

export const folderResolver: GraphQLFieldResolver<
Folder,
Expand All @@ -23,6 +24,6 @@ export const allFoldersResolver: GraphQLFieldResolver<
> = async (_, params, context, info): Promise<Folder[]> => {
const [permissions, u] = await perms(context, params.id, true);
if (permissions !== 'Admin') doAuthError('Access Denied');

return await allSubFoldersRecursive(params.id);
const folders = (await allSubFoldersRecursive(params.id)) as unknown;
return folders as GqlFolder[];
};
2 changes: 0 additions & 2 deletions backend/graphql/resolvers/resolverHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import Folder from '../../models/Folder';
import File from '../../models/File';
import { FolderIsUnderFolderId } from '../../auth/folderUtils';
import { Op } from 'sequelize';
import { MinimalFolder } from '../../../frontend/types';

export const getFolder = async (id: string | number) => {
const folder = await Folder.findByPk(id);
Expand Down

0 comments on commit 3d26a2c

Please sign in to comment.