diff --git a/apps/api/server/src/routes/rest/routes/mod.rs b/apps/api/server/src/routes/rest/routes/mod.rs index ced93cb5c..eb97dbeaa 100644 --- a/apps/api/server/src/routes/rest/routes/mod.rs +++ b/apps/api/server/src/routes/rest/routes/mod.rs @@ -32,7 +32,7 @@ pub fn router() -> Router { .nest("/organizations", organizations::router()) .nest("/chats", chats::router()) .nest("/messages", messages::router()) - .nest("/metrics", metrics::router()) + .nest("/metric_files", metrics::router()) .nest("/dashboards", dashboards::router()) .nest("/users", users::router()) .nest("/collections", collections::router()) diff --git a/apps/web/src/api/buster_rest/metrics/requests.ts b/apps/web/src/api/buster_rest/metrics/requests.ts index af2b91ec6..3f60a4b1f 100644 --- a/apps/web/src/api/buster_rest/metrics/requests.ts +++ b/apps/web/src/api/buster_rest/metrics/requests.ts @@ -25,14 +25,14 @@ import { mainApi } from '../instances'; export const getMetric = async (params: GetMetricRequest): Promise => { return mainApi - .get(`/metrics/${params.id}`, { + .get(`/metric_files/${params.id}`, { params }) .then((res) => res.data); }; export const getMetric_server = async ({ id, password }: Parameters[0]) => { - return await serverFetch(`/metrics/${id}`, { + return await serverFetch(`/metric_files/${id}`, { params: { ...(password && { password }) } }); }; @@ -43,25 +43,25 @@ export const getMetricData = async ({ password }: GetMetricDataRequest): Promise => { return mainApi - .get(`/metrics/${id}/data`, { params: { password, version_number } }) + .get(`/metric_files/${id}/data`, { params: { password, version_number } }) .then((res) => res.data); }; export const listMetrics = async (params: GetMetricListRequest) => { - return mainApi.get('/metrics', { params }).then((res) => res.data); + return mainApi.get('/metric_files', { params }).then((res) => res.data); }; export const listMetrics_server = async (params: Parameters[0]) => { - return await serverFetch('/metrics', { params }); + return await serverFetch('/metric_files', { params }); }; export const updateMetric = async (params: UpdateMetricRequest) => { - return mainApi.put(`/metrics/${params.id}`, params).then((res) => res.data); + return mainApi.put(`/metric_files/${params.id}`, params).then((res) => res.data); }; export const deleteMetrics = async (data: DeleteMetricRequest) => { return mainApi - .delete('/metrics', { + .delete('/metric_files', { data }) .then((res) => res.data); @@ -69,7 +69,7 @@ export const deleteMetrics = async (data: DeleteMetricRequest) => { export const duplicateMetric = async (params: DuplicateMetricRequest) => { return mainApi - .post('/metrics/duplicate', params) + .post('/metric_files/duplicate', params) .then((res) => res.data); }; @@ -77,7 +77,7 @@ export const bulkUpdateMetricVerificationStatus = async ( params: BulkUpdateMetricVerificationStatusRequest ) => { return mainApi - .put('/metrics', params) + .put('/metric_files', params) .then((res) => res.data); }; @@ -85,13 +85,13 @@ export const bulkUpdateMetricVerificationStatus = async ( export const shareMetric = async ({ id, params }: { id: string; params: ShareMetricRequest }) => { return mainApi - .post(`/metrics/${id}/sharing`, params) + .post(`/metric_files/${id}/sharing`, params) .then((res) => res.data); }; export const unshareMetric = async ({ id, data }: { id: string; data: ShareDeleteRequest }) => { return mainApi - .delete(`/metrics/${id}/sharing`, { data }) + .delete(`/metric_files/${id}/sharing`, { data }) .then((res) => res.data); }; @@ -102,5 +102,5 @@ export const updateMetricShare = async ({ id: string; params: ShareUpdateRequest; }) => { - return mainApi.put(`/metrics/${id}/sharing`, params).then((res) => res.data); + return mainApi.put(`/metric_files/${id}/sharing`, params).then((res) => res.data); };