chore: refacto NestJS in modules (#308)
* chore: wip refacto in modules * fix: rollback port * fix: jwt guard in wrong folder * chore: rename folder exception-filter in filters * fix: tests are running * fix: excessive stack depth comparing types * fix: auth issue * chore: move createUser in UserService * fix: test * fix: guards * fix: jwt guard don't handle falsy user
This commit is contained in:
15
server/src/utils/prepare-find-many.ts
Normal file
15
server/src/utils/prepare-find-many.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { Workspace } from '@prisma/client';
|
||||
|
||||
type FindManyArgsType = { where?: object; orderBy?: object };
|
||||
|
||||
export const prepareFindManyArgs = <T extends FindManyArgsType>(
|
||||
args: T,
|
||||
workspace: Workspace,
|
||||
): T => {
|
||||
args.where = {
|
||||
...args.where,
|
||||
...{ workspace: { is: { id: { equals: workspace.id } } } },
|
||||
};
|
||||
|
||||
return args;
|
||||
};
|
||||
Reference in New Issue
Block a user