fix sql
This commit is contained in:
@@ -19,11 +19,33 @@ export function shouldNormalizeInputDigits(options: {
|
||||
inputmode?: string
|
||||
}): boolean {
|
||||
if (options.isPassword) {
|
||||
return false
|
||||
return true
|
||||
}
|
||||
if (options.type === 'price' || options.type === 'number') {
|
||||
const type = String(options.type ?? '').trim().toLowerCase()
|
||||
if (type === 'price' || type === 'number' || type === 'tel') {
|
||||
return true
|
||||
}
|
||||
const mode = String(options.inputmode ?? '').trim().toLowerCase()
|
||||
return mode === 'numeric' || mode === 'decimal' || mode === 'number'
|
||||
}
|
||||
|
||||
/** تبدیل ارقام فارسی/عربی در فیلدهای عددی فرمهای احراز هویت و پروفایل */
|
||||
export function normalizeAuthFormFields(fields: {
|
||||
mobile?: string | null
|
||||
password?: string | null
|
||||
token?: string | null
|
||||
n_code?: string | number | null
|
||||
}) {
|
||||
if (fields.mobile != null && fields.mobile !== '') {
|
||||
fields.mobile = persianToEnglishDigits(String(fields.mobile).trim())
|
||||
}
|
||||
if (fields.password != null && fields.password !== '') {
|
||||
fields.password = persianToEnglishDigits(String(fields.password))
|
||||
}
|
||||
if (fields.token != null && fields.token !== '') {
|
||||
fields.token = persianToEnglishDigits(String(fields.token).trim())
|
||||
}
|
||||
if (fields.n_code != null && fields.n_code !== '') {
|
||||
fields.n_code = persianToEnglishDigits(String(fields.n_code).trim())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user