update service status

This commit is contained in:
2024-10-23 15:43:50 +07:00
parent 7e55f4093b
commit 2872ac69ef
14 changed files with 212 additions and 32 deletions

View File

@@ -8,6 +8,7 @@ import {
import { Builder } from '../Graphql/graphql.builder';
import { PrismaService } from '../Prisma/prisma.service';
import { MinioService } from '../Minio/minio.service';
import { ServiceStatus } from '@prisma/client';
@Injectable()
export class ServiceSchema extends PothosSchema {
constructor(
@@ -55,6 +56,11 @@ export class ServiceSchema extends PothosSchema {
imageFileUrl: t.exposeString('imageFileUrl', {
description: 'The URL of the image file for the service.',
}),
status: t.expose('status', {
type: ServiceStatus,
nullable: true,
description: 'The status of the service.',
}),
createdAt: t.expose('createdAt', {
type: 'DateTime',
nullable: true,
@@ -125,6 +131,7 @@ export class ServiceSchema extends PothosSchema {
description:
'Retrieve a list of services with optional filtering, ordering, and pagination.',
type: [this.service()],
args: this.builder.generator.findManyArgs('Service'),
resolve: async (query, root, args, ctx, info) => {
return await this.prisma.service.findMany({