fix(frontend): handle supplier price parsing
This commit is contained in:
@@ -425,7 +425,11 @@ const buildPayload = () => {
|
|||||||
|
|
||||||
payload.constructeurIds = uniqueConstructeurIds(creationForm.constructeurIds)
|
payload.constructeurIds = uniqueConstructeurIds(creationForm.constructeurIds)
|
||||||
|
|
||||||
const rawPrice = creationForm.supplierPrice.trim()
|
const rawPrice = typeof creationForm.supplierPrice === 'string'
|
||||||
|
? creationForm.supplierPrice.trim()
|
||||||
|
: creationForm.supplierPrice === null || creationForm.supplierPrice === undefined
|
||||||
|
? ''
|
||||||
|
: String(creationForm.supplierPrice).trim()
|
||||||
if (rawPrice) {
|
if (rawPrice) {
|
||||||
const parsed = Number(rawPrice)
|
const parsed = Number(rawPrice)
|
||||||
if (!Number.isNaN(parsed)) {
|
if (!Number.isNaN(parsed)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user