fixed vendor-uploads.php conflicts
This commit is contained in:
parent
155cd3df6e
commit
152d9832ff
|
@ -485,24 +485,6 @@ $array = json_decode($result, true);
|
|||
formData.append('category', 'product');
|
||||
formData.append('image', resizedFile);
|
||||
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('File upload failed');
|
||||
throw new Error('File upload failed');
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
const filename = result.filename;
|
||||
|
||||
const payload = {
|
||||
product_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/product_uploads/${filename}`,
|
||||
};
|
||||
fetch('https://api.obanana.shop/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
|
|
Loading…
Reference in New Issue