Skip to content

Commit

Permalink
Add back isForm when setting position within the create Discussions A…
Browse files Browse the repository at this point in the history
…PI (#3497)
  • Loading branch information
jdalrymple authored Dec 31, 2023
1 parent 4230e59 commit 406f997
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/core/src/templates/ResourceDiscussions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ export class ResourceDiscussions<C extends boolean = false> extends BaseResource

if (position) {
Object.assign(opts, reformatObjectOptions(position, 'position', true));

opts.isForm = true;
}

return RequestHelper.post<DiscussionSchema>()(
Expand Down
1 change: 1 addition & 0 deletions packages/core/test/unit/templates/ResourceDiscussions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ describe('ResourceDiscussions.create', () => {

expect(RequestHelper.post()).toHaveBeenCalledWith(service, '1/resource2/2/discussions', {
body: 'test',
isForm: true,
'position[base_sha]': 'sha1',
'position[start_sha]': 'sha2',
'position[head_sha]': 'sha3',
Expand Down

0 comments on commit 406f997

Please sign in to comment.