Skip to content

Commit

Permalink
fix: Fix job rerun api error
Browse files Browse the repository at this point in the history
Signed-off-by: leoliu <leoliu@yunify.com>
  • Loading branch information
leoliu committed Jul 17, 2020
1 parent 0176478 commit 38393a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
7 changes: 2 additions & 5 deletions src/pages/clusters/containers/Workload/Jobs/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class Jobs extends React.Component {
}

get itemActions() {
const { trigger } = this.props
const { trigger, store } = this.props
return [
{
key: 'edit',
Expand All @@ -79,10 +79,7 @@ export default class Jobs extends React.Component {
icon: 'refresh',
text: t('Rerun'),
action: 'edit',
onClick: item =>
trigger('job.rerun', {
detail: item,
}),
onClick: item => store.rerun(item),
},
{
key: 'delete',
Expand Down
7 changes: 2 additions & 5 deletions src/pages/projects/containers/Jobs/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default class Jobs extends React.Component {
}

get itemActions() {
const { trigger } = this.props
const { trigger, store } = this.props
return [
{
key: 'edit',
Expand All @@ -81,10 +81,7 @@ export default class Jobs extends React.Component {
icon: 'refresh',
text: t('Rerun'),
action: 'edit',
onClick: item =>
trigger('job.rerun', {
detail: item,
}),
onClick: item => store.rerun(item),
},
{
key: 'delete',
Expand Down
2 changes: 1 addition & 1 deletion src/stores/workload/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default class WorkloadStore extends Base {
rerun({ name, cluster, namespace, resourceVersion }) {
return this.submitting(
request.post(
`kapis/resources.kubesphere.io/v1alpha2${this.getPath({
`kapis/operations.kubesphere.io/v1alpha2${this.getPath({
cluster,
namespace,
})}/jobs/${name}?action=rerun&resourceVersion=${resourceVersion}`
Expand Down

0 comments on commit 38393a4

Please sign in to comment.