permission update on querystore
This commit is contained in:
parent
ce8157e6bf
commit
3c4380c91b
1 changed files with 9 additions and 7 deletions
|
@ -5,6 +5,7 @@ import type { AxiosResponse } from "axios";
|
|||
import { useQueryBuilderStore } from "./queryBuilder";
|
||||
import { useModalStore } from "../modal";
|
||||
import { defineAsyncComponent, markRaw } from "vue";
|
||||
import { useAbilityStore } from "../ability";
|
||||
|
||||
export const useQueryStoreStore = defineStore("queryStore", {
|
||||
state: () => {
|
||||
|
@ -32,19 +33,20 @@ export const useQueryStoreStore = defineStore("queryStore", {
|
|||
triggerSave() {
|
||||
const queryBuilderStore = useQueryBuilderStore();
|
||||
const modalStore = useModalStore();
|
||||
if (queryBuilderStore.activeQueryId == undefined) {
|
||||
modalStore.openModal(
|
||||
markRaw(
|
||||
defineAsyncComponent(() => import("@/components/admin/settings/queryStore/CreateQueryStoreModal.vue"))
|
||||
)
|
||||
);
|
||||
} else {
|
||||
const abilityStore = useAbilityStore();
|
||||
if (queryBuilderStore.activeQueryId != undefined && abilityStore.can("update", "settings", "query_store")) {
|
||||
modalStore.openModal(
|
||||
markRaw(
|
||||
defineAsyncComponent(() => import("@/components/admin/settings/queryStore/UpdateQueryStoreModal.vue"))
|
||||
),
|
||||
queryBuilderStore.activeQueryId
|
||||
);
|
||||
} else {
|
||||
modalStore.openModal(
|
||||
markRaw(
|
||||
defineAsyncComponent(() => import("@/components/admin/settings/queryStore/CreateQueryStoreModal.vue"))
|
||||
)
|
||||
);
|
||||
}
|
||||
},
|
||||
async createQueryStore(query: CreateQueryViewModel): Promise<AxiosResponse<any, any>> {
|
||||
|
|
Loading…
Reference in a new issue