update order and fix approve center
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
||||
import { Builder } from '../Graphql/graphql.builder';
|
||||
import { PrismaService } from '../Prisma/prisma.service';
|
||||
import { MinioService } from '../Minio/minio.service';
|
||||
import { CenterStatus } from '@prisma/client';
|
||||
import { CenterStatus, Role } from '@prisma/client';
|
||||
import { MailService } from '../Mail/mail.service';
|
||||
@Injectable()
|
||||
export class CenterSchema extends PothosSchema {
|
||||
@@ -231,6 +231,15 @@ export class CenterSchema extends PothosSchema {
|
||||
if (!centerOwner) {
|
||||
throw new Error('Center owner not found');
|
||||
}
|
||||
await prisma.user.update({
|
||||
where: {
|
||||
id: centerOwnerId,
|
||||
},
|
||||
data: {
|
||||
role: Role.CENTER_OWNER,
|
||||
},
|
||||
});
|
||||
// update center status
|
||||
const updatedCenter = await prisma.center.update({
|
||||
...query,
|
||||
where: {
|
||||
|
||||
Reference in New Issue
Block a user