diff options
author | Michael Muré <batolettre@gmail.com> | 2018-08-02 23:37:49 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-08-02 23:37:49 +0200 |
commit | d8f89726fec3822d7d1dd42c52f478f37003b534 (patch) | |
tree | 567e97ee605ef3a286e42e11535fa6516321e743 /graphql/resolvers/mutation.go | |
parent | ed8f7eca9a8e0d1c448a7cc6240e2b7e357cf354 (diff) | |
download | git-bug-d8f89726fec3822d7d1dd42c52f478f37003b534.tar.gz |
implement media hosting in git for comments + API for the webui
Diffstat (limited to 'graphql/resolvers/mutation.go')
-rw-r--r-- | graphql/resolvers/mutation.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/graphql/resolvers/mutation.go b/graphql/resolvers/mutation.go index a85459f2..2a81716c 100644 --- a/graphql/resolvers/mutation.go +++ b/graphql/resolvers/mutation.go @@ -5,6 +5,7 @@ import ( "github.com/MichaelMure/git-bug/bug" "github.com/MichaelMure/git-bug/cache" + "github.com/MichaelMure/git-bug/util" ) type mutationResolver struct { @@ -19,13 +20,13 @@ func (r mutationResolver) getRepo(repoRef *string) (cache.RepoCacher, error) { return r.cache.DefaultRepo() } -func (r mutationResolver) NewBug(ctx context.Context, repoRef *string, title string, message string) (bug.Snapshot, error) { +func (r mutationResolver) NewBug(ctx context.Context, repoRef *string, title string, message string, files []util.Hash) (bug.Snapshot, error) { repo, err := r.getRepo(repoRef) if err != nil { return bug.Snapshot{}, err } - b, err := repo.NewBug(title, message) + b, err := repo.NewBugWithFiles(title, message, files) if err != nil { return bug.Snapshot{}, err } @@ -56,7 +57,7 @@ func (r mutationResolver) Commit(ctx context.Context, repoRef *string, prefix st return *snap, nil } -func (r mutationResolver) AddComment(ctx context.Context, repoRef *string, prefix string, message string) (bug.Snapshot, error) { +func (r mutationResolver) AddComment(ctx context.Context, repoRef *string, prefix string, message string, files []util.Hash) (bug.Snapshot, error) { repo, err := r.getRepo(repoRef) if err != nil { return bug.Snapshot{}, err @@ -67,7 +68,7 @@ func (r mutationResolver) AddComment(ctx context.Context, repoRef *string, prefi return bug.Snapshot{}, err } - err = b.AddComment(message) + err = b.AddCommentWithFiles(message, files) if err != nil { return bug.Snapshot{}, err } |