aboutsummaryrefslogtreecommitdiffstats
path: root/bug/op_edit_comment.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-02-09 20:08:12 +0100
committerMichael Muré <batolettre@gmail.com>2020-02-09 20:23:38 +0100
commitb3d3612393387c83fa43f908dbb8e2a71068c834 (patch)
treee4609e21dc74e535d45b38cd7d0504681c544160 /bug/op_edit_comment.go
parentdca85b309a0a82e9993a345964d0831ab2876fb4 (diff)
parent3caffeef4d2ed25d4eb5d4bfd262f4fc3b92561f (diff)
downloadgit-bug-b3d3612393387c83fa43f908dbb8e2a71068c834.tar.gz
Merge remote-tracking branch 'origin/master' into cheshirekow-jira
Diffstat (limited to 'bug/op_edit_comment.go')
-rw-r--r--bug/op_edit_comment.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/bug/op_edit_comment.go b/bug/op_edit_comment.go
index fecba67a..f82e7590 100644
--- a/bug/op_edit_comment.go
+++ b/bug/op_edit_comment.go
@@ -24,6 +24,9 @@ type EditCommentOperation struct {
Files []git.Hash `json:"files"`
}
+// Sign-post method for gqlgen
+func (op *EditCommentOperation) IsOperation() {}
+
func (op *EditCommentOperation) base() *OpBase {
return &op.OpBase
}
@@ -59,14 +62,11 @@ func (op *EditCommentOperation) Apply(snapshot *Snapshot) {
UnixTime: timestamp.Timestamp(op.UnixTime),
}
- switch target.(type) {
+ switch target := target.(type) {
case *CreateTimelineItem:
- item := target.(*CreateTimelineItem)
- item.Append(comment)
-
+ target.Append(comment)
case *AddCommentTimelineItem:
- item := target.(*AddCommentTimelineItem)
- item.Append(comment)
+ target.Append(comment)
}
// Updating the corresponding comment