changes
This commit is contained in:
@@ -86,8 +86,10 @@ async function submit() {
|
||||
// 1. insert row to Product_Image, get back id
|
||||
if (uploadedImage.value) {
|
||||
const productImage = await $insertapi("Product_Image", {
|
||||
name: uploadedImage.value.name,
|
||||
path: $buildFileUrl(uploadedImage.value.file),
|
||||
data: {
|
||||
name: uploadedImage.value.name,
|
||||
path: $buildFileUrl(uploadedImage.value.file),
|
||||
},
|
||||
});
|
||||
body.value.image = productImage.id;
|
||||
}
|
||||
@@ -99,7 +101,7 @@ async function submit() {
|
||||
id: props.variantId,
|
||||
...trimmedBody,
|
||||
})
|
||||
: await $insertapi("Product_Variant", trimmedBody);
|
||||
: await $insertapi("Product_Variant", { data: trimmedBody });
|
||||
if (res !== "error") {
|
||||
if (refreshData) refreshData();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user