fix(tenants): remove extra brace breaking nest build
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -437,20 +437,20 @@ export class TenantsService {
|
|||||||
if (!(error instanceof Prisma.PrismaClientKnownRequestError)) {
|
if (!(error instanceof Prisma.PrismaClientKnownRequestError)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (error.code === 'P2002') {
|
if (error.code !== 'P2002') {
|
||||||
const targets = Array.isArray(error.meta?.target)
|
return;
|
||||||
? (error.meta.target as string[])
|
|
||||||
: [];
|
|
||||||
if (targets.includes('slug')) {
|
|
||||||
throw new ConflictException('slug تکراری است — این slug قبلاً برای نسخه دیگری ثبت شده');
|
|
||||||
}
|
|
||||||
if (targets.includes('domain')) {
|
|
||||||
throw new ConflictException(
|
|
||||||
'دامنه تکراری است — این دامنه قبلاً دامنهٔ اصلی نسخه دیگری است',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
throw new ConflictException('slug یا domain تکراری است');
|
|
||||||
}
|
}
|
||||||
|
const targets = Array.isArray(error.meta?.target)
|
||||||
|
? (error.meta.target as string[])
|
||||||
|
: [];
|
||||||
|
if (targets.includes('slug')) {
|
||||||
|
throw new ConflictException('slug تکراری است — این slug قبلاً برای نسخه دیگری ثبت شده');
|
||||||
}
|
}
|
||||||
|
if (targets.includes('domain')) {
|
||||||
|
throw new ConflictException(
|
||||||
|
'دامنه تکراری است — این دامنه قبلاً دامنهٔ اصلی نسخه دیگری است',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
throw new ConflictException('slug یا domain تکراری است');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user