changes
This commit is contained in:
@@ -23,7 +23,7 @@ function displayModal() {
|
||||
|
||||
const refreshData = inject("refreshData");
|
||||
async function deleteProduct() {
|
||||
const res = await $deleteapi("product", props.product.id);
|
||||
const res = await $deleteapi("Product", props.product.id);
|
||||
if (res !== "error") {
|
||||
if (refreshData) refreshData();
|
||||
}
|
||||
|
||||
@@ -73,11 +73,11 @@ const refreshData = inject("refreshData");
|
||||
async function submit() {
|
||||
isPending.value = true;
|
||||
const res = props.variantId
|
||||
? await $patchapi("product", {
|
||||
? await $patchapi("Product", {
|
||||
id: productVariant.value.product,
|
||||
...body.value,
|
||||
})
|
||||
: await $insertapi("product", { data: body.value });
|
||||
: await $insertapi("Product", { data: body.value });
|
||||
if (res !== "error") {
|
||||
if (refreshData) refreshData();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user