mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
13 lines
428 B
CoffeeScript
13 lines
428 B
CoffeeScript
Darkswarm.factory "EnterpriseImageService", (FileUploader, spreeApiKey) ->
|
|
new class EnterpriseImageService
|
|
imageSrc: null
|
|
|
|
imageUploader: new FileUploader
|
|
headers:
|
|
'X-Spree-Token': spreeApiKey
|
|
autoUpload: true
|
|
|
|
configure: (enterprise) =>
|
|
@imageUploader.url = "/api/enterprises/#{enterprise.id}/update_image"
|
|
@imageUploader.onSuccessItem = (image, response) => @imageSrc = response
|