diff --git a/commentapi/comment.go b/commentapi/comment.go index 1a1190d..031120c 100644 --- a/commentapi/comment.go +++ b/commentapi/comment.go @@ -88,6 +88,7 @@ type CreateArgs struct { SigningTS string `json:"signing_ts"` MentionedChannels []MentionedChannel `json:"mentioned_channels"` IsProtected bool `json:"is_protected"` + DryRun bool `json:"dry_run"` } // CreateResponse response for the comment.Create rpc call diff --git a/server/services/v1/comments/create.go b/server/services/v1/comments/create.go index 907dea5..0fcea5c 100644 --- a/server/services/v1/comments/create.go +++ b/server/services/v1/comments/create.go @@ -119,6 +119,11 @@ func create(_ *http.Request, args *commentapi.CreateArgs, reply *commentapi.Crea return err } + if args.DryRun { + reply.CommentItem = &item + return nil + } + err = request.comment.Insert(db.RW, boil.Infer()) if err != nil { return err