chore: update subproject commit and enhance ServiceFeedback schema
- Updated the subproject commit reference in epess-database to the latest version. - Added Logger to the ServiceFeedback schema for improved logging of arguments during feedback submission. - Modified the Prisma types to include new Quiz and Question entities, enhancing the schema's capabilities and data structure.
This commit is contained in:
Submodule epess-database updated: 6ed88c39ed...a2116a20f5
8
src/Quiz/quiz.module.ts
Normal file
8
src/Quiz/quiz.module.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Module } from '@nestjs/common'
|
||||
import { QuizSchema } from './quiz.schema'
|
||||
|
||||
@Module({
|
||||
providers: [QuizSchema],
|
||||
exports: [QuizSchema],
|
||||
})
|
||||
export class QuizModule {}
|
||||
4
src/Quiz/quiz.schema.ts
Normal file
4
src/Quiz/quiz.schema.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { Injectable } from '@nestjs/common'
|
||||
|
||||
@Injectable()
|
||||
export class QuizSchema {}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Inject, Injectable } from '@nestjs/common'
|
||||
import { Inject, Injectable, Logger } from '@nestjs/common'
|
||||
import { Pothos, PothosRef, PothosSchema, SchemaBuilderToken } from '@smatch-corp/nestjs-pothos'
|
||||
import { Builder } from '../Graphql/graphql.builder'
|
||||
import { PrismaService } from '../Prisma/prisma.service'
|
||||
@@ -94,6 +94,7 @@ export class ServiceFeedbackSchema extends PothosSchema {
|
||||
if (!ctx.http?.me) throw new Error('Unauthorized')
|
||||
// allow only when user is CUSTOMER and order is completed
|
||||
if (ctx.http?.me?.role !== Role.CUSTOMER) throw new Error('Unauthorized')
|
||||
Logger.log(`args: ${JSON.stringify(args)}`)
|
||||
const order = await this.prisma.order.findFirst({
|
||||
where: {
|
||||
id: args.orderId,
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user