Compare commits
No commits in common. "58e25b77597a266265e3b6b6e10ac00d4e588975" and "8ff10a09159ef074b300b92571ac9263f41479d1" have entirely different histories.
58e25b7759
...
8ff10a0915
|
@ -11,8 +11,5 @@ export const rules = {
|
||||||
},
|
},
|
||||||
price: value => {
|
price: value => {
|
||||||
return (typeof value == 'number' || typeof value == 'undefined' || value === null) || 'Стоимость должна быть числом';
|
return (typeof value == 'number' || typeof value == 'undefined' || value === null) || 'Стоимость должна быть числом';
|
||||||
},
|
|
||||||
isNumber: value => {
|
|
||||||
return /^\d+[\.,\,]?\d*$/.test(value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ export default {
|
||||||
if (this.price == ''){
|
if (this.price == ''){
|
||||||
this.price = null;
|
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)
|
this.price = parseFloat(this.price)
|
||||||
}
|
}
|
||||||
let validateName = rules.notNull(this.name);
|
let validateName = rules.notNull(this.name);
|
||||||
|
|
|
@ -35,7 +35,7 @@ export default {
|
||||||
if (this.price == ""){
|
if (this.price == ""){
|
||||||
this.price = null;
|
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)
|
this.price = parseFloat(this.price)
|
||||||
}
|
}
|
||||||
let validateId = rules.id(this.wish_id);
|
let validateId = rules.id(this.wish_id);
|
||||||
|
|
Loading…
Reference in New Issue