change: make query id to uuid

This commit is contained in:
Julian Krauser 2025-03-26 11:11:42 +01:00
parent 3376746867
commit b1daa7e64f
5 changed files with 11 additions and 12 deletions

View file

@ -13,8 +13,7 @@ export const useQueryBuilderStore = defineStore("queryBuilder", {
loadingData: "fetched" as "loading" | "fetched" | "failed",
queryError: "" as string | { sql: string; code: string; msg: string },
query: undefined as undefined | DynamicQueryStructure | string,
activeQueryId: undefined as undefined | number,
isLoadedQuery: undefined as undefined | number,
activeQueryId: undefined as undefined | string,
};
},
actions: {

View file

@ -31,7 +31,7 @@ export const useQueryStoreStore = defineStore("queryStore", {
this.loading = "failed";
});
},
fetchQueryById(id: number): Promise<AxiosResponse<any, any>> {
fetchQueryById(id: string): Promise<AxiosResponse<any, any>> {
return http.get(`/admin/querystore/${id}`);
},
triggerSave() {

View file

@ -8,7 +8,7 @@ export interface NewsletterViewModel {
newsletterText: string;
newsletterSignatur: string;
isSent: boolean;
recipientsByQueryId?: number | null;
recipientsByQueryId?: string | null;
recipientsByQuery?: QueryViewModel | null;
}
@ -23,7 +23,7 @@ export interface SyncNewsletterViewModel {
newsletterTitle: string;
newsletterText: string;
newsletterSignatur: string;
recipientsByQueryId?: number;
recipientsByQueryId?: string;
}
export interface SendNewsletterViewModel {

View file

@ -7,7 +7,7 @@ export interface TableMeta {
}
export interface QueryViewModel {
id: number;
id: string;
title: string;
query: string | DynamicQueryStructure;
}
@ -18,6 +18,6 @@ export interface CreateQueryViewModel {
}
export interface UpdateQueryViewModel {
id: number;
id: string;
query: string | DynamicQueryStructure;
}

View file

@ -134,10 +134,10 @@ export default defineComponent({
if (val == "def") {
this.activeNewsletterObj.recipientsByQueryId = null;
this.activeNewsletterObj.recipientsByQuery = null;
} else if (this.queries.find((q) => q.id == parseInt(val))) {
this.activeNewsletterObj.recipientsByQueryId = parseInt(val);
this.activeNewsletterObj.recipientsByQuery = cloneDeep(this.queries.find((q) => q.id == parseInt(val)));
this.sendQuery(0, 1000, this.recipientsByQuery?.query);
} else if (this.queries.find((q) => q.id == val)) {
this.activeNewsletterObj.recipientsByQueryId = val;
this.activeNewsletterObj.recipientsByQuery = cloneDeep(this.queries.find((q) => q.id == val));
this.sendQuery(0, 0, this.recipientsByQuery?.query, true);
}
},
},
@ -171,7 +171,7 @@ export default defineComponent({
},
loadQuery() {
if (this.recipientsByQuery) {
this.sendQuery(0, 1000, this.recipientsByQuery.query);
this.sendQuery(0, 0, this.recipientsByQuery.query, true);
}
},
},