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 { useQueryBuilderStore } from "./queryBuilder";
|
||||||
import { useModalStore } from "../modal";
|
import { useModalStore } from "../modal";
|
||||||
import { defineAsyncComponent, markRaw } from "vue";
|
import { defineAsyncComponent, markRaw } from "vue";
|
||||||
|
import { useAbilityStore } from "../ability";
|
||||||
|
|
||||||
export const useQueryStoreStore = defineStore("queryStore", {
|
export const useQueryStoreStore = defineStore("queryStore", {
|
||||||
state: () => {
|
state: () => {
|
||||||
|
@ -32,19 +33,20 @@ export const useQueryStoreStore = defineStore("queryStore", {
|
||||||
triggerSave() {
|
triggerSave() {
|
||||||
const queryBuilderStore = useQueryBuilderStore();
|
const queryBuilderStore = useQueryBuilderStore();
|
||||||
const modalStore = useModalStore();
|
const modalStore = useModalStore();
|
||||||
if (queryBuilderStore.activeQueryId == undefined) {
|
const abilityStore = useAbilityStore();
|
||||||
modalStore.openModal(
|
if (queryBuilderStore.activeQueryId != undefined && abilityStore.can("update", "settings", "query_store")) {
|
||||||
markRaw(
|
|
||||||
defineAsyncComponent(() => import("@/components/admin/settings/queryStore/CreateQueryStoreModal.vue"))
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
modalStore.openModal(
|
modalStore.openModal(
|
||||||
markRaw(
|
markRaw(
|
||||||
defineAsyncComponent(() => import("@/components/admin/settings/queryStore/UpdateQueryStoreModal.vue"))
|
defineAsyncComponent(() => import("@/components/admin/settings/queryStore/UpdateQueryStoreModal.vue"))
|
||||||
),
|
),
|
||||||
queryBuilderStore.activeQueryId
|
queryBuilderStore.activeQueryId
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
modalStore.openModal(
|
||||||
|
markRaw(
|
||||||
|
defineAsyncComponent(() => import("@/components/admin/settings/queryStore/CreateQueryStoreModal.vue"))
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async createQueryStore(query: CreateQueryViewModel): Promise<AxiosResponse<any, any>> {
|
async createQueryStore(query: CreateQueryViewModel): Promise<AxiosResponse<any, any>> {
|
||||||
|
|
Loading…
Reference in a new issue