@@ -54,18 +54,18 @@ export default class GroupManager extends BaseManager<Group> implements GroupMan
54
54
*/
55
55
create ( options : GroupCreateOptions ) : Promise < Group >
56
56
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
62
62
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' }
65
65
}
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 } )
69
69
const group = this . _upsert ( new Group ( this . client , res ) )
70
70
if ( res . members ) {
71
71
res . members . forEach ( data => {
0 commit comments