From 2ec2c5e6ba69e11c93ee2978b7b463e6cdde7cd2 Mon Sep 17 00:00:00 2001 From: ilan7empest Date: Mon, 18 Dec 2023 20:21:01 +0700 Subject: [PATCH] Fix [Jobs] Change 'runs' endpoint 'project name' --- src/actions/projects.js | 1 - src/api/jobs-api.js | 9 +++------ src/api/projects-api.js | 7 ++++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/actions/projects.js b/src/actions/projects.js index 756b0f1d6..2db3e44c5 100644 --- a/src/actions/projects.js +++ b/src/actions/projects.js @@ -323,7 +323,6 @@ const projectsAction = { dispatch(projectsAction.fetchProjectJobsBegin()) const params = { - project, 'partition-by': 'name', 'partition-sort-by': 'updated', 'rows-per-partition': '5', diff --git a/src/api/jobs-api.js b/src/api/jobs-api.js index f9532b51c..767669901 100644 --- a/src/api/jobs-api.js +++ b/src/api/jobs-api.js @@ -80,34 +80,31 @@ const jobsApi = { params: { 'partition-by': 'name', 'partition-sort-by': 'updated', - project, ...generateRequestParams(filters) } } - return mainHttpClient.get('/runs', newConfig) + return mainHttpClient.get(`/projects/${project}/runs`, newConfig) }, getSpecificJobs: (project, filters, jobList) => { const params = { - project, ...generateRequestParams(filters) } const jobListQuery = jobList.map(value => `uid=${value}`).join('&') - return mainHttpClient.get(`/runs?${jobListQuery}`, { params }) + return mainHttpClient.get(`/projects/${project}/runs?${jobListQuery}`, { params }) }, getAllJobRuns: (project, filters, config = {}, jobName) => { const newConfig = { ...config, params: { - project, name: jobName, ...generateRequestParams(filters) } } - return mainHttpClient.get('/runs', newConfig) + return mainHttpClient.get(`/projects/${project}/runs`, newConfig) }, getJob: (project, jobId, iter) => { const params = {} diff --git a/src/api/projects-api.js b/src/api/projects-api.js index 65afdd504..4e26e871b 100644 --- a/src/api/projects-api.js +++ b/src/api/projects-api.js @@ -37,13 +37,14 @@ const projectsApi = { deleteSecret: (project, key) => mainHttpClient.delete(`/projects/${project}/secrets?provider=kubernetes&secret=${key}`), editProject: (project, data) => mainHttpClient.put(`/projects/${project}`, data), - getJobsAndWorkflows: (project, params) => mainHttpClient.get('/runs', { params }), + getJobsAndWorkflows: (project, params) => + mainHttpClient.get(`/projects/${project}/runs`, { params }), getProject: project => mainHttpClient.get(`/projects/${project}`), getProjectDataSets: project => mainHttpClient.get(`/projects/${project}/artifacts?category=dataset`), getProjectFailedJobs: (project, signal) => mainHttpClient.get( - `/runs?project=${project}&state=error&start_time_from=${new Date( + `/projects/${project}/runs?state=error&start_time_from=${new Date( Date.now() - 24 * 60 * 60 * 1000 ).toISOString()}`, { @@ -64,7 +65,7 @@ const projectsApi = { signal: signal }), getProjectRunningJobs: (project, signal) => - mainHttpClient.get(`/runs?project=${project}&state=running`, { + mainHttpClient.get(`/projects/${project}/runs?state=running`, { signal: signal }), getProjectScheduledJobs: project => mainHttpClient.get(`/projects/${project}/schedules`),