Skip to content

Commit

Permalink
feat: enhance comment bitbucket
Browse files Browse the repository at this point in the history
  • Loading branch information
amalhanaja committed Jul 6, 2024
1 parent 6325df9 commit 4c313d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/infrastructure/http/bitbucket/payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ package bitbucket

type PostPullRequestCommentRequest struct {
Content *PullRequestCommentContent `json:"content"`
Inline *PullRequestCommentInline `json:"inline"`
}

type PullRequestCommentContent struct {
Raw string `json:"raw"`
}

type PullRequestCommentInline struct {
Path string `json:"path"`
}

type PullRequestResponse struct {
CommentCount int64 `json:"comment_count"`
TaskCount int64 `json:"task_count"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ func (c *client) PostPullRequestComment(ctx context.Context, input domain.PostPu
Content: &PullRequestCommentContent{
Raw: input.Comment,
},
Inline: &PullRequestCommentInline{
Path: input.Path,
},
}
if err := c.doRequest(ctx, http.MethodPost, fmt.Sprintf("/pullrequests/%s/comments", input.PullRequestId), payload, &response); err != nil {
return err
Expand Down

0 comments on commit 4c313d0

Please sign in to comment.