test(server): move tests out of src folder (#4366)

This commit is contained in:
LongYinan
2023-09-15 00:34:14 -07:00
committed by GitHub
parent b5e8fecfd0
commit 1aec1ce7d0
36 changed files with 233 additions and 159 deletions
@@ -26,7 +26,6 @@ import {
Resolver,
} from '@nestjs/graphql';
import type { User, Workspace } from '@prisma/client';
// @ts-expect-error graphql-upload is not typed
import GraphQLUpload from 'graphql-upload/GraphQLUpload.mjs';
import { applyUpdate, Doc } from 'yjs';
@@ -648,10 +647,10 @@ export class WorkspaceResolver {
workspaceId,
},
});
return (
userWorkspace?.accepted &&
(await this.permissions.grantPage(workspaceId, pageId))
);
if (!userWorkspace?.accepted) {
throw new ForbiddenException('Permission denied');
}
return this.permissions.grantPage(workspaceId, pageId);
}
@Mutation(() => Boolean)