Skip to content

Commit 24c6a5a

Browse files
authored
Merge pull request #1162 from merico-dev/1158-show-query-name-in-request-params
1158 show query name in request params
2 parents 8dbbca3 + 34fac83 commit 24c6a5a

File tree

7 files changed

+13
-11
lines changed

7 files changed

+13
-11
lines changed

api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtable/api",
3-
"version": "10.28.0",
3+
"version": "10.29.0",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

dashboard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtable/dashboard",
3-
"version": "10.28.0",
3+
"version": "10.29.0",
44
"license": "Apache-2.0",
55
"publishConfig": {
66
"access": "public",

dashboard/src/api-caller/index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ export type QueryFailureError = {
1111
};
1212

1313
interface IQueryBySQL {
14-
title: string;
14+
name: string;
1515
query: { type: DataSourceType; key: string; sql: string; pre_process: string; post_process: string };
1616
payload: TPayloadForSQL;
1717
}
1818

19-
export async function queryBySQL({ query, payload }: IQueryBySQL, signal: AbortSignal) {
19+
export async function queryBySQL({ query, name, payload }: IQueryBySQL, signal: AbortSignal) {
2020
if (!query.sql) {
2121
return [];
2222
}
2323
const { type, key, sql, pre_process, post_process } = query;
2424

2525
const formattedSQL = formatSQL(sql, payload);
2626
const finalSQL = preProcessSQLQuery({ sql: formattedSQL, pre_process });
27-
let data = await APIClient.query(signal)({ type, key, query: finalSQL }, {});
27+
let data = await APIClient.query(signal)({ type, key, query: finalSQL }, { params: { name } });
2828
data = postProcessSQLQuery(post_process, data);
2929
return data;
3030
}
@@ -33,10 +33,11 @@ interface IQueryByHTTP {
3333
type: DataSourceType;
3434
key: string;
3535
configString: string;
36+
name: string;
3637
}
3738

38-
export async function queryByHTTP({ type, key, configString }: IQueryByHTTP, signal: AbortSignal) {
39-
const res = await APIClient.query(signal)({ type, key, query: configString }, {});
39+
export async function queryByHTTP({ type, key, configString, name }: IQueryByHTTP, signal: AbortSignal) {
40+
const res = await APIClient.query(signal)({ type, key, query: configString }, { params: { name } });
4041
return res;
4142
}
4243

dashboard/src/model/render-model/dashboard/content/queries/query.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export const QueryRenderModel = types
109109
queryBySQL(
110110
{
111111
payload,
112-
title: self.name,
112+
name: self.name,
113113
query: self.json,
114114
},
115115
self.controller.signal,
@@ -152,6 +152,7 @@ export const QueryRenderModel = types
152152
type,
153153
key,
154154
configString: JSON.stringify(config),
155+
name: self.name,
155156
},
156157
self.controller.signal,
157158
),

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtable/root",
3-
"version": "10.28.0",
3+
"version": "10.29.0",
44
"private": true,
55
"workspaces": [
66
"api",

settings-form/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtable/settings-form",
3-
"version": "10.28.0",
3+
"version": "10.29.0",
44
"license": "Apache-2.0",
55
"publishConfig": {
66
"access": "public",

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@devtable/website",
33
"private": true,
44
"license": "Apache-2.0",
5-
"version": "10.28.0",
5+
"version": "10.29.0",
66
"scripts": {
77
"dev": "vite",
88
"preview": "vite preview"

0 commit comments

Comments
 (0)