fix: fixed improper imports in auth module

This commit is contained in:
Balu Babu
2023-01-09 18:56:40 +05:30
parent 32765b2d34
commit 90bc0483ae
8 changed files with 19 additions and 11 deletions

View File

@@ -20,4 +20,4 @@ ENV APP_PORT=${PORT}
ENV DB_URL=${DATABASE_URL}
ENV PRODUCTION=true
CMD ["pnpm", "run", "start:dev"]
CMD ["pnpm", "run", "start"]

View File

@@ -23,5 +23,3 @@ services:
environment:
POSTGRES_PASSWORD: testpass
POSTGRES_DB: hoppscotch

View File

@@ -29,6 +29,7 @@
"@nestjs/passport": "^9.0.0",
"@nestjs/platform-express": "^9.2.1",
"@prisma/client": "^4.7.1",
"@types/bcrypt": "^5.0.0",
"apollo-server-express": "^3.11.1",
"apollo-server-plugin-base": "^3.7.1",
"argon2": "^0.30.3",

View File

@@ -27,6 +27,8 @@ export class GqlAuthGuard implements CanActivate {
name: 'exampleUser',
image: 'http://example.com/avatar',
email: 'me@example.com',
isAdmin: false,
createdOn: new Date(),
};
ctx.user = authUser;

View File

@@ -1,5 +1,5 @@
import { Injectable, OnModuleInit, OnModuleDestroy } from '@nestjs/common';
import { PrismaClient } from '@prisma/client/scripts/default-index';
import { PrismaClient } from '@prisma/client';
@Injectable()
export class PrismaService

View File

@@ -26,14 +26,12 @@ export class User {
image?: string;
@Field({
nullable: true,
description: 'Flag to determine if user is an Admin or not',
})
isAdmin?: string;
isAdmin: boolean;
@Field({
nullable: true,
description: 'Date when the user account was created',
})
createdOn?: string;
createdOn: Date;
}

View File

@@ -2,10 +2,11 @@ import { Module } from '@nestjs/common';
import { UserResolver } from './user.resolver';
import { PubSubModule } from 'src/pubsub/pubsub.module';
import { UserService } from './user.service';
import { PrismaModule } from 'src/prisma/prisma.module';
@Module({
imports: [PubSubModule],
providers: [UserResolver],
imports: [PubSubModule, PrismaModule],
providers: [UserResolver, UserService],
exports: [UserService],
})
export class UserModule {}

8
pnpm-lock.yaml generated
View File

@@ -56,6 +56,7 @@ importers:
'@nestjs/testing': ^9.2.1
'@prisma/client': ^4.7.1
'@relmify/jest-fp-ts': ^2.0.2
'@types/bcrypt': ^5.0.0
'@types/express': ^4.17.14
'@types/jest': ^27.5.2
'@types/node': ^18.11.10
@@ -105,6 +106,7 @@ importers:
'@nestjs/passport': 9.0.0_6o47igfla2pj7yzh7agpvpttka
'@nestjs/platform-express': 9.2.1_hjcqpoaebdr7gdo5hgc22hthbe
'@prisma/client': 4.8.1_prisma@4.8.1
'@types/bcrypt': 5.0.0
apollo-server-express: 3.11.1_4mq2c443wwzwcb6dpxnwkfvrzm
apollo-server-plugin-base: 3.7.1_graphql@15.8.0
argon2: 0.30.3
@@ -5168,6 +5170,12 @@ packages:
'@babel/types': 7.18.7
dev: true
/@types/bcrypt/5.0.0:
resolution: {integrity: sha512-agtcFKaruL8TmcvqbndlqHPSJgsolhf/qPWchFlgnW1gECTN/nKbFcoFnvKAQRFfKbh+BO6A3SWdJu9t+xF3Lw==}
dependencies:
'@types/node': 18.11.10
dev: false
/@types/body-parser/1.19.2:
resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==}
dependencies: