Skip to content

Commit

Permalink
Fix [Jobs] Change 'runs' endpoint 'project name'
Browse files Browse the repository at this point in the history
  • Loading branch information
ilan7empest committed Dec 18, 2023
1 parent 19d87ce commit 2ec2c5e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/actions/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ const projectsAction = {
dispatch(projectsAction.fetchProjectJobsBegin())

const params = {
project,
'partition-by': 'name',
'partition-sort-by': 'updated',
'rows-per-partition': '5',
Expand Down
9 changes: 3 additions & 6 deletions src/api/jobs-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down
7 changes: 4 additions & 3 deletions src/api/projects-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`,
{
Expand All @@ -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`),
Expand Down

0 comments on commit 2ec2c5e

Please sign in to comment.