diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-25 18:01:32 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-25 18:01:32 +0200 |
commit | 6a12373965aff9f80147f8b5bff6a5a104927365 (patch) | |
tree | ccc1e34fba059512acab39286a86f6b73c5ad318 /bug/operations/create.go | |
parent | 49c90eab26875cbf3094d9a546ad29b426e174a1 (diff) | |
download | git-bug-6a12373965aff9f80147f8b5bff6a5a104927365.tar.gz |
more refactoring to have reusable bug action across different UI
Diffstat (limited to 'bug/operations/create.go')
-rw-r--r-- | bug/operations/create.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bug/operations/create.go b/bug/operations/create.go index 72eba843..0fd1225e 100644 --- a/bug/operations/create.go +++ b/bug/operations/create.go @@ -33,3 +33,11 @@ func (op CreateOperation) Apply(snapshot bug.Snapshot) bug.Snapshot { } return snapshot } + +func Create(author bug.Person, title, message string) (*bug.Bug, error) { + newBug := bug.NewBug() + createOp := NewCreateOp(author, title, message) + newBug.Append(createOp) + + return newBug, nil +} |