Skip to content

Commit

Permalink
PMM-12710 fix api paths
Browse files Browse the repository at this point in the history
  • Loading branch information
YashSartanpara1 committed Jun 5, 2024
1 parent 3439d60 commit 9ec6263
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { apiRequestQAN } from 'shared/components/helpers/api';
import { apiRequest } from 'shared/components/helpers/api';
import { getLabelQueryParams } from 'pmm-qan/panel/QueryAnalytics.tools';
import { HistogramRequest, HistogramResponse } from './Metrics.types';

Expand All @@ -15,7 +15,7 @@ export const getMetrics = async ({
totals,
};

return apiRequestQAN.post<any, any>(':getMetrics', body);
return apiRequest.post<any, any>('/v1/qan:getMetrics', body);
};

export const getHistogram = async ({
Expand All @@ -28,7 +28,7 @@ export const getHistogram = async ({
period_start_to: to,
};

return apiRequestQAN.post<HistogramResponse, HistogramRequest>(':getHistogram', body);
return apiRequest.post<HistogramResponse, HistogramRequest>('/v1/qan:getHistogram', body);
};

export default {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { apiRequestActions } from 'shared/components/helpers/api';
import { apiRequest } from 'shared/components/helpers/api';

export default {
getTraditionalExplainJSONMongo(body) {
const requestBody = { mongodb_explain: body };

return apiRequestActions.post<any, any>(':startServiceAction', requestBody);
return apiRequest.post<any, any>('/v1/actions:startServiceAction', requestBody);
},
};
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
import { apiRequestActions } from 'shared/components/helpers/api';
import { apiRequest } from 'shared/components/helpers/api';

export default {
getShowCreateTableMySQL(body) {
const requestBody = { mysql_show_create_table: body };

return apiRequestActions.post<any, any>(':startServiceAction', requestBody);
return apiRequest.post<any, any>('/v1/actions:startServiceAction', requestBody);
},

getMysqlTableStatus(body) {
const requestBody = { mysql_show_table_status: body };

return apiRequestActions.post<any, any>(':startServiceAction', requestBody);
return apiRequest.post<any, any>('/v1/actions:startServiceAction', requestBody);
},

getMysqlIndex(body) {
const requestBody = { mysql_show_index: body };

return apiRequestActions.post<any, any>(':startServiceAction', requestBody);
return apiRequest.post<any, any>('/v1/actions:startServiceAction', requestBody);
},

getTraditionalExplainJSONMysql(body) {
const requestBody = { mysql_explain_traditional_json: body };

return apiRequestActions.post<any, any>(':startServiceAction', requestBody);
return apiRequest.post<any, any>('/v1/actions:startServiceAction', requestBody);
},

getTraditionalExplainMysql(body) {
const requestBody = { mysql_explain_json: body };

return apiRequestActions.post<any, any>(':startServiceAction', requestBody);
return apiRequest.post<any, any>('/v1/actions:startServiceAction', requestBody);
},
};
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { apiRequestActions } from 'shared/components/helpers/api';
import { apiRequest } from 'shared/components/helpers/api';

export default {
getPostgreSQLIndex(body) {
const requestBody = { postgres_show_index: body };

return apiRequestActions.post<any, any>(':startServiceAction', requestBody);
return apiRequest.post<any, any>('/v1/actions:startServiceAction', requestBody);
},
getShowCreateTablePostgreSQL(body) {
const requestBody = { postgres_show_create_table: body };

return apiRequestActions.post<any, any>(':startServiceAction', requestBody);
return apiRequest.post<any, any>('/v1/actions:startServiceAction', requestBody);
},
};
4 changes: 2 additions & 2 deletions pmm-app/src/shared/components/Actions/Actions.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { apiRequestActions } from '../helpers/api';
import { apiRequest } from '../helpers/api';
import { ActionRequest, ActionResponse } from './Actions.types';

export const ActionsService = {
getActionResult(body: ActionRequest): Promise<ActionResponse> {
return apiRequestActions.get<any, any>(`/${body.action_id}`);
return apiRequest.get<any, any>(`/v1/actions/${body.action_id}`);
},
};
1 change: 0 additions & 1 deletion pmm-app/src/shared/components/helpers/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,3 @@ export const apiRequestQAN = new ApiRequest({ baseURL: '/v1/qan' });
export const apiRequestManagement = new ApiRequest({ baseURL: '/v1/management' });
export const apiRequestInventory = new ApiRequest({ baseURL: '/v1/inventory' });
export const apiRequestSettings = new ApiRequest({ baseURL: '/v1/Settings' });
export const apiRequestActions = new ApiRequest({ baseURL: '/v1/actions' });

0 comments on commit 9ec6263

Please sign in to comment.