Compare commits

..

No commits in common. "58e25b77597a266265e3b6b6e10ac00d4e588975" and "8ff10a09159ef074b300b92571ac9263f41479d1" have entirely different histories.

3 changed files with 2 additions and 5 deletions

View File

@ -11,8 +11,5 @@ export const rules = {
},
price: value => {
return (typeof value == 'number' || typeof value == 'undefined' || value === null) || 'Стоимость должна быть числом';
},
isNumber: value => {
return /^\d+[\.,\,]?\d*$/.test(value);
}
}

View File

@ -27,7 +27,7 @@ export default {
if (this.price == ''){
this.price = null;
}
if (typeof this.price == 'string' && rules.isNumber(this.price)){
if (typeof this.price == 'string' && /^\d+[\.,\,]?\d+$/.test(this.price)){
this.price = parseFloat(this.price)
}
let validateName = rules.notNull(this.name);

View File

@ -35,7 +35,7 @@ export default {
if (this.price == ""){
this.price = null;
}
if (typeof this.price == 'string' && rules.isNumber(this.price)){
if (typeof this.price == 'string' && /^\d+[\.,\,]?\d+$/.test(this.price)){
this.price = parseFloat(this.price)
}
let validateId = rules.id(this.wish_id);