add invite staff

This commit is contained in:
2024-10-27 16:48:56 +07:00
parent cb6a210308
commit 1a7b5a5fb6
6 changed files with 81 additions and 13 deletions

View File

@@ -215,10 +215,7 @@ export class CenterSchema extends PothosSchema {
throw new Error('Center not found');
}
// check if center is already approved or rejected
if (
center.centerStatus === CenterStatus.APPROVED ||
center.centerStatus === CenterStatus.REJECTED
) {
if (center.centerStatus !== CenterStatus.PENDING) {
throw new Error('Center is already approved or rejected');
}
// find center owner and promote to staff