Skip to content

Commit db9b776

Browse files
committed
fix(Groups): rename reqBody to body for consistent naming
1 parent 79902a8 commit db9b776

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/managers/GroupManager.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,18 @@ export default class GroupManager extends BaseManager<Group> implements GroupMan
5454
*/
5555
create(options: GroupCreateOptions): Promise<Group>
5656
public async create(options: GroupCreateOptions): Promise<Group> {
57-
const reqBody: PostGroupBody = { name: options.name }
58-
if (options.type !== undefined) reqBody.type = options.type
59-
if (options.description !== undefined) reqBody.description = options.description
60-
if (options.image_url !== undefined) reqBody.image_url = options.description
61-
if (options.share !== undefined) reqBody.share = options.share
57+
const body: PostGroupBody = { name: options.name }
58+
if (options.type !== undefined) body.type = options.type
59+
if (options.description !== undefined) body.description = options.description
60+
if (options.image_url !== undefined) body.image_url = options.description
61+
if (options.share !== undefined) body.share = options.share
6262
if (options.join_question !== undefined) {
63-
reqBody.show_join_question = true
64-
reqBody.join_question = { text: options.join_question, type: 'join_reason/questions/text' }
63+
body.show_join_question = true
64+
body.join_question = { text: options.join_question, type: 'join_reason/questions/text' }
6565
}
66-
if (options.requires_approval !== undefined) reqBody.requires_approval = options.requires_approval
67-
if (options.office_mode !== undefined) reqBody.office_mode = options.office_mode
68-
const res = await this.client.rest.api<PostGroupResponse>('POST', 'groups', { body: reqBody })
66+
if (options.requires_approval !== undefined) body.requires_approval = options.requires_approval
67+
if (options.office_mode !== undefined) body.office_mode = options.office_mode
68+
const res = await this.client.rest.api<PostGroupResponse>('POST', 'groups', { body })
6969
const group = this._upsert(new Group(this.client, res))
7070
if (res.members) {
7171
res.members.forEach(data => {

0 commit comments

Comments
 (0)