diff options
author | Michael Muré <batolettre@gmail.com> | 2021-02-14 11:36:32 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2021-02-14 12:19:50 +0100 |
commit | 3f6ef50883492f77995a7e27872d0b5ae17b9d6a (patch) | |
tree | 97677642f1b01c73c8c5a708ea0ec67ced8c402f /bug/op_add_comment.go | |
parent | 99b9dd84cb4b0cfd3eb1fd50b07c8b826eb52d19 (diff) | |
download | git-bug-3f6ef50883492f77995a7e27872d0b5ae17b9d6a.tar.gz |
bug: migrate to the DAG entity structure!
Diffstat (limited to 'bug/op_add_comment.go')
-rw-r--r-- | bug/op_add_comment.go | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/bug/op_add_comment.go b/bug/op_add_comment.go index e52c46fd..fd00860b 100644 --- a/bug/op_add_comment.go +++ b/bug/op_add_comment.go @@ -24,23 +24,19 @@ type AddCommentOperation struct { // Sign-post method for gqlgen func (op *AddCommentOperation) IsOperation() {} -func (op *AddCommentOperation) base() *OpBase { - return &op.OpBase -} - func (op *AddCommentOperation) Id() entity.Id { - return idOperation(op) + return idOperation(op, &op.OpBase) } func (op *AddCommentOperation) Apply(snapshot *Snapshot) { - snapshot.addActor(op.Author) - snapshot.addParticipant(op.Author) + snapshot.addActor(op.Author_) + snapshot.addParticipant(op.Author_) commentId := entity.CombineIds(snapshot.Id(), op.Id()) comment := Comment{ id: commentId, Message: op.Message, - Author: op.Author, + Author: op.Author_, Files: op.Files, UnixTime: timestamp.Timestamp(op.UnixTime), } @@ -59,7 +55,7 @@ func (op *AddCommentOperation) GetFiles() []repository.Hash { } func (op *AddCommentOperation) Validate() error { - if err := opBaseValidate(op, AddCommentOp); err != nil { + if err := op.OpBase.Validate(op, AddCommentOp); err != nil { return err } |