Merge pull request #9301 from mkllnk/3975-unsupported-image

Allow SVG images for products and show errors when uploading unsupported file
This commit is contained in:
jibees
2022-07-21 16:56:11 +02:00
committed by GitHub
9 changed files with 80 additions and 46 deletions

View File

@@ -13,3 +13,9 @@ angular.module("ofn.admin").factory "ProductImageService", (FileUploader, SpreeA
@imageUploader.onSuccessItem = (image, response) =>
product.thumb_url = response.thumb_url
product.image_url = response.image_url
@imageUploader.onErrorItem = (image, response) =>
if Array.isArray(response.errors)
message = response.errors.join("\n")
else
message = response.error.toString()
alert(message)