+9
appview/indexer/notifier.go
+9
appview/indexer/notifier.go
···
19
19
}
20
20
}
21
21
22
+
func (ix *Indexer) NewIssueClosed(ctx context.Context, issue *models.Issue) {
23
+
l := log.FromContext(ctx).With("notifier", "indexer.NewIssueClosed", "issue", issue)
24
+
l.Debug("updating an issue")
25
+
err := ix.Issues.Index(ctx, *issue)
26
+
if err != nil {
27
+
l.Error("failed to index an issue", "err", err)
28
+
}
29
+
}
30
+
22
31
func (ix *Indexer) DeleteIssue(ctx context.Context, issue *models.Issue) {
23
32
l := log.FromContext(ctx).With("notifier", "indexer.DeleteIssue", "issue", issue)
24
33
l.Debug("deleting an issue")
+8
appview/issues/issues.go
+8
appview/issues/issues.go
···
305
305
rp.pages.Notice(w, "issue-action", "Failed to close issue. Try again later.")
306
306
return
307
307
}
308
+
// change the issue state (this will pass down to the notifiers)
309
+
issue.Open = false
308
310
309
311
// notify about the issue closure
310
312
rp.notifier.NewIssueClosed(r.Context(), issue)
···
353
355
rp.pages.Notice(w, "issue-action", "Failed to reopen issue. Try again later.")
354
356
return
355
357
}
358
+
// change the issue state (this will pass down to the notifiers)
359
+
issue.Open = true
360
+
361
+
// // notify about the issue reopen
362
+
// rp.notifier.NewIssueReopen(r.Context(), issue)
363
+
356
364
rp.pages.HxLocation(w, fmt.Sprintf("/%s/issues/%d", f.OwnerSlashRepo(), issue.IssueId))
357
365
return
358
366
} else {