Having my tiny custom field:
<template>
<div>
<k-image :src="value" />
<k-upload ref="upload" @success="onSuccess" />
<k-button icon="upload" @click="upload">Upload</k-button>
</div>
</template>
and some methods with it:
methods: {
upload() {
this.$refs.upload.open({
url: window.panel.api + '/media/freePicturesPost',
accept: "image/*",
multiple: true
});
},
onSuccess (uploads, response) {
// i.e.
console.log(uploads);
console.log(response);
// etc.
}
},
Uploading my file works fine; here is the response I get from my own API endpoint:
{"foo":"bar","payload":"https:\/\/xxxblob.core.windows.net\/path\/apfel.jpeg"}
What I am wondering is that in onSuccess() the second argument is undefined, but should contain the API response according to
https://getkirby.com/docs/reference/plugins/ui/upload
The first parameter is not empty, but does not contain the api response.
Why that?