From c46d01f8c10e6363b680fa6876e91bd8eaf3bb3e Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 29 Sep 2018 20:41:19 +0200 Subject: bug: implement comment edition - add a new operation - add a new "timeline" in the snapshot that hold a processed version of the operations --- bug/operation_pack.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'bug/operation_pack.go') diff --git a/bug/operation_pack.go b/bug/operation_pack.go index 5238ea60..f33d94bf 100644 --- a/bug/operation_pack.go +++ b/bug/operation_pack.go @@ -74,23 +74,27 @@ func (opp *OperationPack) UnmarshalJSON(data []byte) error { func (opp *OperationPack) unmarshalOp(raw []byte, _type OperationType) (Operation, error) { switch _type { case CreateOp: - op := CreateOperation{} + op := &CreateOperation{} err := json.Unmarshal(raw, &op) return op, err case SetTitleOp: - op := SetTitleOperation{} + op := &SetTitleOperation{} err := json.Unmarshal(raw, &op) return op, err case AddCommentOp: - op := AddCommentOperation{} + op := &AddCommentOperation{} err := json.Unmarshal(raw, &op) return op, err case SetStatusOp: - op := SetStatusOperation{} + op := &SetStatusOperation{} err := json.Unmarshal(raw, &op) return op, err case LabelChangeOp: - op := LabelChangeOperation{} + op := &LabelChangeOperation{} + err := json.Unmarshal(raw, &op) + return op, err + case EditCommentOp: + op := &EditCommentOperation{} err := json.Unmarshal(raw, &op) return op, err default: -- cgit