Skip to content

Commit cdb1e80

Browse files
committed
assume
1 parent 3957352 commit cdb1e80

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

routers/web/repo/actions/view.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -560,9 +560,9 @@ func Cancel(ctx *context_module.Context) {
560560
if len(updatedjobs) > 0 {
561561
job := updatedjobs[0]
562562
actions_service.NotifyWorkflowRunStatusUpdateWithReload(ctx, job)
563-
notify_service.WorkflowRunStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job.Run)
564563
}
565-
ctx.JSON(http.StatusOK, struct{}{})
564+
565+
ctx.JSONOK()
566566
}
567567

568568
func Approve(ctx *context_module.Context) {
@@ -603,18 +603,16 @@ func Approve(ctx *context_module.Context) {
603603

604604
actions_service.CreateCommitStatus(ctx, jobs...)
605605

606-
if len(updatedjobs) > 0 {
607-
job := updatedjobs[0]
608-
actions_service.NotifyWorkflowRunStatusUpdateWithReload(ctx, job)
609-
notify_service.WorkflowRunStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job.Run)
610-
}
611-
612606
for _, job := range updatedjobs {
613607
_ = job.LoadAttributes(ctx)
614608
notify_service.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil)
615609
}
610+
if len(updatedjobs) > 0 {
611+
job := updatedjobs[0]
612+
actions_service.NotifyWorkflowRunStatusUpdateWithReload(ctx, job)
613+
}
616614

617-
ctx.JSON(http.StatusOK, struct{}{})
615+
ctx.JSONOK()
618616
}
619617

620618
func Delete(ctx *context_module.Context) {

0 commit comments

Comments
 (0)