update gi cung duoc
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import { Inject, Injectable } from '@nestjs/common'
|
||||
import { Pothos, PothosRef, PothosSchema, SchemaBuilderToken } from '@smatch-corp/nestjs-pothos'
|
||||
import {
|
||||
Pothos,
|
||||
PothosRef,
|
||||
PothosSchema,
|
||||
SchemaBuilderToken,
|
||||
} from '@smatch-corp/nestjs-pothos'
|
||||
import { Builder } from '../Graphql/graphql.builder'
|
||||
import { PrismaService } from '../Prisma/prisma.service'
|
||||
import { ChatRoomType } from '@prisma/client'
|
||||
@@ -57,6 +62,9 @@ export class ChatroomSchema extends PothosSchema {
|
||||
type: 'DateTime',
|
||||
description: 'The last activity date and time.',
|
||||
}),
|
||||
order: t.relation('Order', {
|
||||
description: 'The order.',
|
||||
}),
|
||||
}),
|
||||
})
|
||||
}
|
||||
@@ -78,7 +86,8 @@ export class ChatroomSchema extends PothosSchema {
|
||||
|
||||
chatRooms: t.prismaField({
|
||||
type: [this.chatRoom()],
|
||||
description: 'Retrieve a list of chat rooms with optional filtering, ordering, and pagination.',
|
||||
description:
|
||||
'Retrieve a list of chat rooms with optional filtering, ordering, and pagination.',
|
||||
args: this.builder.generator.findManyArgs('ChatRoom'),
|
||||
resolve: async (query, _root, args, _ctx, _info) => {
|
||||
return await this.prisma.chatRoom.findMany({
|
||||
|
||||
@@ -39,7 +39,7 @@ import { WorkshopModule } from '../Workshop/workshop.module'
|
||||
import { WorkshopOrganizationModule } from '../WorkshopOrganization/workshoporganization.module'
|
||||
import { WorkshopSubscriptionModule } from '../WorkshopSubscription/workshopsubscription.module'
|
||||
import { initContextCache } from '@pothos/core'
|
||||
import { PubSub } from 'graphql-subscriptions'
|
||||
import { RedisPubSub } from 'graphql-redis-subscriptions'
|
||||
import { DocumentModule } from 'src/Document/document.module'
|
||||
import { Context } from 'graphql-ws'
|
||||
import { FinanceModule } from 'src/Finance/finance.module'
|
||||
@@ -88,7 +88,10 @@ import { FinanceModule } from 'src/Finance/finance.module'
|
||||
GraphQLModule.forRootAsync<ApolloDriverConfig>({
|
||||
driver: PothosApolloDriver,
|
||||
inject: [GraphqlService, 'PUB_SUB'],
|
||||
useFactory: async (graphqlService: GraphqlService, pubsub: PubSub) => ({
|
||||
useFactory: async (
|
||||
graphqlService: GraphqlService,
|
||||
pubsub: RedisPubSub,
|
||||
) => ({
|
||||
path: process.env.API_PATH + '/graphql',
|
||||
debug: process.env.NODE_ENV === 'development' || false,
|
||||
playground: process.env.NODE_ENV === 'development' || false,
|
||||
@@ -178,7 +181,11 @@ import { FinanceModule } from 'src/Finance/finance.module'
|
||||
},
|
||||
{
|
||||
provide: 'PUB_SUB',
|
||||
useFactory: () => new PubSub(),
|
||||
useFactory: () =>
|
||||
new RedisPubSub({
|
||||
connection:
|
||||
process.env.REDIS_PUBSUB_URL ?? 'redis://10.0.27.1:6379/7',
|
||||
}),
|
||||
},
|
||||
],
|
||||
exports: [
|
||||
|
||||
@@ -394,7 +394,6 @@ export class UserSchema extends PothosSchema {
|
||||
firstName: args.firstName as string,
|
||||
lastName: args.lastName as string,
|
||||
})
|
||||
Logger.log(clerkUser, 'Clerk User')
|
||||
// update bank account number and bank bin to database
|
||||
if (args.input?.bankAccountNumber) {
|
||||
await this.prisma.user.update({
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user