Skip to content

Commit c3a7f15

Browse files
committed
Revert "assume"
This reverts commit cdb1e80.
1 parent 1d9c378 commit c3a7f15

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

routers/web/repo/actions/view.go

Lines changed: 9 additions & 7 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)
563564
}
564-
565-
ctx.JSONOK()
565+
ctx.JSON(http.StatusOK, struct{}{})
566566
}
567567

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

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

606-
for _, job := range updatedjobs {
607-
_ = job.LoadAttributes(ctx)
608-
notify_service.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil)
609-
}
610606
if len(updatedjobs) > 0 {
611607
job := updatedjobs[0]
612608
actions_service.NotifyWorkflowRunStatusUpdateWithReload(ctx, job)
609+
notify_service.WorkflowRunStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job.Run)
613610
}
614611

615-
ctx.JSONOK()
612+
for _, job := range updatedjobs {
613+
_ = job.LoadAttributes(ctx)
614+
notify_service.WorkflowJobStatusUpdate(ctx, job.Run.Repo, job.Run.TriggerUser, job, nil)
615+
}
616+
617+
ctx.JSON(http.StatusOK, struct{}{})
616618
}
617619

618620
func Delete(ctx *context_module.Context) {

0 commit comments

Comments
 (0)