refactor: img dialog => remove img function

This commit is contained in:
puriphatt 2024-09-12 16:41:09 +07:00
parent 42bb43f618
commit 7ab9f69ef8
6 changed files with 82 additions and 78 deletions

View file

@ -4280,15 +4280,15 @@ watch(
@add-image="
async (v) => {
if (!v) return;
if (!currentIdProduct) return;
if (!currentIdProduct && !currentIdService) return;
const res = await productServiceStore.addImageList(
v,
currentIdProduct,
dialogProductEdit ? currentIdProduct : currentIdService,
Date.now(),
dialogProductEdit ? 'product' : 'service',
);
await fetchImageList(
currentIdProduct,
dialogProductEdit ? currentIdProduct : currentIdService,
res,
dialogProductEdit ? 'product' : 'service',
);
@ -4308,7 +4308,9 @@ watch(
);
await fetchImageList(
dialogProductEdit ? currentIdProduct : currentIdService,
name,
dialogProductEdit
? formDataProduct.selectedImage || ''
: formDataProductService.selectedImage || '',
type,
);
}