enhance: use QueryStoreId to fetch query
This commit is contained in:
parent
916e61897a
commit
a20c0d3ed3
3 changed files with 23 additions and 21 deletions
|
@ -2,6 +2,7 @@ import { defineStore } from "pinia";
|
|||
import { http } from "@/serverCom";
|
||||
import type { TableMeta } from "@/viewmodels/admin/configuration/query.models";
|
||||
import type { DynamicQueryStructure, FieldType } from "@/types/dynamicQueries";
|
||||
import type { AxiosResponse } from "axios";
|
||||
|
||||
export const useQueryBuilderStore = defineStore("queryBuilder", {
|
||||
state: () => {
|
||||
|
@ -58,6 +59,16 @@ export const useQueryBuilderStore = defineStore("queryBuilder", {
|
|||
this.loadingData = "failed";
|
||||
});
|
||||
},
|
||||
async sendQueryByStoreId(
|
||||
id: string,
|
||||
offset = 0,
|
||||
count = 25,
|
||||
noLimit: boolean = false
|
||||
): Promise<AxiosResponse<any, any>> {
|
||||
return await http.post(
|
||||
`/admin/querybuilder/query/${id}?` + (noLimit ? `noLimit=true` : `offset=${offset}&count=${count}`)
|
||||
);
|
||||
},
|
||||
clearResults() {
|
||||
this.data = [];
|
||||
this.totalLength = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue