Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back isForm when setting position within the create Discussions API #3497

Merged
merged 2 commits into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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