fix: display platform registration errors inside the creation modal
This commit is contained in:
@@ -2178,9 +2178,7 @@ export class InstructorService {
|
||||
organizationId,
|
||||
organizationName,
|
||||
),
|
||||
displayName: {
|
||||
startsWith: baseName,
|
||||
},
|
||||
platformId: masterPlatform.id,
|
||||
},
|
||||
select: {
|
||||
displayName: true,
|
||||
@@ -2227,7 +2225,11 @@ export class InstructorService {
|
||||
});
|
||||
} catch (error) {
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError && error.code === 'P2002') {
|
||||
throw new ConflictException('Platform name already exists');
|
||||
const target = error.meta?.target;
|
||||
if (Array.isArray(target) && target.includes('instance_no')) {
|
||||
throw new ConflictException('플랫폼 등록번호가 중복되었습니다. 다시 등록해 주세요.');
|
||||
}
|
||||
throw new ConflictException('이미 사용 중인 플랫폼 이름입니다. 다른 이름을 입력해 주세요.');
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user