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

@@ -2,7 +2,7 @@ version: '3.0'
services:
local:
build: .
command: ["pnpm", "run", "start:dev"]
command: [ "pnpm", "run", "start:dev" ]
environment:
- PRODUCTION=false
- DATABASE_URL=postgresql://postgres:testpass@dev-db:5432/hoppscotch?connect_timeout=300
@@ -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 {}