diff options
author | Michael Muré <batolettre@gmail.com> | 2021-04-09 13:01:14 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2021-04-09 13:01:14 +0200 |
commit | 1520f678f7a2bc6e01d9b01df5ce49f2f46be7d7 (patch) | |
tree | f6d71c1f29cf06ccab9e4ae434b19ab17caa4385 /bug/op_set_status.go | |
parent | 0fd570171d171aa574d7f01d6033a9c01d668465 (diff) | |
parent | bc5f618eba812859bf87ce2c31b278bd518d4555 (diff) | |
download | git-bug-1520f678f7a2bc6e01d9b01df5ce49f2f46be7d7.tar.gz git-bug-1520f678f7a2bc6e01d9b01df5ce49f2f46be7d7.zip |
Merge remote-tracking branch 'origin/master' into dev-gh-bridge
Diffstat (limited to 'bug/op_set_status.go')
-rw-r--r-- | bug/op_set_status.go | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/bug/op_set_status.go b/bug/op_set_status.go index eb2c0ba4..e22ded54 100644 --- a/bug/op_set_status.go +++ b/bug/op_set_status.go @@ -18,24 +18,17 @@ type SetStatusOperation struct { Status Status `json:"status"` } -// Sign-post method for gqlgen -func (op *SetStatusOperation) IsOperation() {} - -func (op *SetStatusOperation) base() *OpBase { - return &op.OpBase -} - func (op *SetStatusOperation) Id() entity.Id { - return idOperation(op) + return idOperation(op, &op.OpBase) } func (op *SetStatusOperation) Apply(snapshot *Snapshot) { snapshot.Status = op.Status - snapshot.addActor(op.Author) + snapshot.addActor(op.Author_) item := &SetStatusTimelineItem{ id: op.Id(), - Author: op.Author, + Author: op.Author_, UnixTime: timestamp.Timestamp(op.UnixTime), Status: op.Status, } @@ -44,7 +37,7 @@ func (op *SetStatusOperation) Apply(snapshot *Snapshot) { } func (op *SetStatusOperation) Validate() error { - if err := opBaseValidate(op, SetStatusOp); err != nil { + if err := op.OpBase.Validate(op, SetStatusOp); err != nil { return err } @@ -55,7 +48,7 @@ func (op *SetStatusOperation) Validate() error { return nil } -// UnmarshalJSON is a two step JSON unmarshaling +// UnmarshalJSON is a two step JSON unmarshalling // This workaround is necessary to avoid the inner OpBase.MarshalJSON // overriding the outer op's MarshalJSON func (op *SetStatusOperation) UnmarshalJSON(data []byte) error { |