mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-11 03:40:20 +00:00
Merge pull request #9380 from jibees/9068-bulk-product-update-creating-new-on_demand-variant
Admin, Products list: fix variant creation when unit is not well formatted and on_demand is checked or on_hand is filled
This commit is contained in:
@@ -5,15 +5,16 @@ angular.module("admin.utils").factory "ErrorsParser", ->
|
||||
return defaultContent unless errors?
|
||||
|
||||
errorsString = ""
|
||||
if errors.length > 0
|
||||
if Array.isArray(errors)
|
||||
# it is an array of errors
|
||||
errorsString = errors.join("\n") + "\n"
|
||||
else
|
||||
else if typeof errors == "object"
|
||||
# it is a hash of errors
|
||||
keys = Object.keys(errors)
|
||||
for key in keys
|
||||
errorsString += errors[key].join("\n") + "\n"
|
||||
|
||||
else # string
|
||||
errorsString = errors
|
||||
this.defaultIfEmpty(errorsString, defaultContent)
|
||||
|
||||
defaultIfEmpty: (content, defaultContent) =>
|
||||
|
||||
Reference in New Issue
Block a user