Changes in Overlay Store
This commit is contained in:
parent
db06ebbaaf
commit
8a9a900fec
|
|
@ -1,5 +1,5 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref, type Ref, onUnmounted } from "vue";
|
||||
import { ref, onUnmounted } from "vue";
|
||||
import { CreateShortCutKey } from "dolphin-components";
|
||||
|
||||
class EscapeKeyManager {
|
||||
|
|
@ -83,22 +83,6 @@ export const createOverlayStore = (storeId: string) => {
|
|||
escapeManager.removeModal(close);
|
||||
}
|
||||
|
||||
async function onSave(
|
||||
genericStore: any,
|
||||
genericAPI: any,
|
||||
fetchList: boolean = true,
|
||||
loadingRef: Ref<boolean> | null = null
|
||||
) {
|
||||
let response: any = false;
|
||||
if (editId.value !== null) {
|
||||
response = await genericStore.updateItem(genericAPI, editId.value, fetchList, loadingRef);
|
||||
} else {
|
||||
response = await genericStore.createItem(genericAPI, fetchList, loadingRef);
|
||||
}
|
||||
if (response) close();
|
||||
return response;
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
if (show.value) {
|
||||
escapeManager.removeModal(close);
|
||||
|
|
@ -115,7 +99,6 @@ export const createOverlayStore = (storeId: string) => {
|
|||
context,
|
||||
open,
|
||||
close,
|
||||
onSave,
|
||||
setOnCloseCallback,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import { ref } from "vue";
|
|||
|
||||
const breadcrumb = ref([
|
||||
{ name: "Dashboard", link: "/" },
|
||||
{ name: "Reports", count: 3 }, // last breadcrumb item
|
||||
{ name: "Reports", count: 3 },
|
||||
]);
|
||||
|
||||
const actions = ref([
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user