changes
This commit is contained in:
@@ -5,7 +5,6 @@ const props = defineProps({
|
||||
variant: Object,
|
||||
});
|
||||
|
||||
const emit = defineEmits(["dynamicCompEvent"]);
|
||||
const { $deleteapi } = useNuxtApp();
|
||||
const showConfirmModal = ref(null);
|
||||
|
||||
@@ -22,11 +21,11 @@ function displayModal() {
|
||||
};
|
||||
}
|
||||
|
||||
const refreshData = inject("refreshData");
|
||||
async function deleteVariant() {
|
||||
const res = await $deleteapi("Product_Variant", props.variant.id);
|
||||
if (res !== "error") {
|
||||
// emit to parent, which is DataTable
|
||||
emit("dynamicCompEvent", { type: "refresh" });
|
||||
if (refreshData) refreshData();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user