mirror of
https://git.meshkee.com/cssd/cssd-front.git
synced 2026-10-11 20:43:17 +03:30
fix : update delete confirmation modal and test result style
This commit is contained in:
@@ -189,7 +189,7 @@ export default {
|
||||
this.load();
|
||||
},
|
||||
methods: {
|
||||
...mapMutations("modal", ["changeCurrentModal"]),
|
||||
...mapMutations("modal", ["changeCurrentModal", "closeModal"]),
|
||||
async load(page = 1) {
|
||||
let filter = '?';
|
||||
for (const key in this.filter) {
|
||||
@@ -218,23 +218,20 @@ export default {
|
||||
},
|
||||
removeModal(id) {
|
||||
this.changeCurrentModal({
|
||||
modal: "modal-delete-delete",
|
||||
properties: {
|
||||
success: () => {
|
||||
this.remove(id);
|
||||
},
|
||||
}
|
||||
});
|
||||
},
|
||||
async remove(id) {
|
||||
const result = await ApiService.delete(urls.removePackage(id));
|
||||
if (result && result.status == 200) {
|
||||
for (const key in this.items) {
|
||||
if (this.items.hasOwnProperty(key) && this.items[key].id == id) {
|
||||
this.items.splice(key, 1);
|
||||
modal: "modal-user-confirmation",
|
||||
properties: {width: '30'},
|
||||
success: async () => {
|
||||
const result = await ApiService.delete(urls.removePackage(id));
|
||||
if (result && result.status == 200) {
|
||||
for (const key in this.items) {
|
||||
if (this.items.hasOwnProperty(key) && this.items[key].id == id) {
|
||||
this.items.splice(key, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.closeModal();
|
||||
},
|
||||
});
|
||||
},
|
||||
async generateBarcode(id, type) {
|
||||
const result = await ApiService.post(urls.Barcode(id, type));
|
||||
|
||||
Reference in New Issue
Block a user