fix(build): ship jalaali types with production dependencies
Move @types/jalaali-js into dependencies and add a local module declaration so nest build works when installing without devDependencies. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -434,12 +434,12 @@ export class TenantsService {
|
||||
}
|
||||
|
||||
private handleUnique(error: unknown) {
|
||||
if (
|
||||
error instanceof Prisma.PrismaClientKnownRequestError &&
|
||||
error.code === 'P2002'
|
||||
) {
|
||||
if (!(error instanceof Prisma.PrismaClientKnownRequestError)) {
|
||||
return;
|
||||
}
|
||||
if (error.code === 'P2002') {
|
||||
const targets = Array.isArray(error.meta?.target)
|
||||
? (error.meta?.target as string[])
|
||||
? (error.meta.target as string[])
|
||||
: [];
|
||||
if (targets.includes('slug')) {
|
||||
throw new ConflictException('slug تکراری است — این slug قبلاً برای نسخه دیگری ثبت شده');
|
||||
@@ -451,5 +451,6 @@ export class TenantsService {
|
||||
}
|
||||
throw new ConflictException('slug یا domain تکراری است');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
declare module 'jalaali-js' {
|
||||
export function toJalaali(
|
||||
gy: number,
|
||||
gm: number,
|
||||
gd: number,
|
||||
): { jy: number; jm: number; jd: number }
|
||||
|
||||
export function toGregorian(
|
||||
jy: number,
|
||||
jm: number,
|
||||
jd: number,
|
||||
): { gy: number; gm: number; gd: number }
|
||||
|
||||
export function isValidJalaaliDate(jy: number, jm: number, jd: number): boolean
|
||||
|
||||
export function isLeapJalaaliYear(jy: number): boolean
|
||||
|
||||
export function jalaaliMonthLength(jy: number, jm: number): number
|
||||
}
|
||||
Reference in New Issue
Block a user