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

Update CreateGroup function #179

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions src/controllers/clientController.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ const getNumberId = async (req, res) => {
*/
const createGroup = async (req, res) => {
try {
const { name, participants } = req.body
const { title, participants, options } = req.body
const client = sessions.get(req.params.sessionId)
const response = await client.createGroup(name, participants)
const response = await client.createGroup(title, participants, options)
res.json({ success: true, response })
} catch (error) {
sendErrorResponse(res, 500, error.message)
Expand Down
63 changes: 61 additions & 2 deletions swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,66 @@
{
"apiKeyAuth": []
}
]
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "Title of the group",
"example": "Test Group"
},
"participants": {
"type": "string",
"description": "Participants ID in Array",
"example": ["[email protected]","[email protected]"]
},
"options": {
"type": "object",
"description": "Optional params",
"example": {
'messageTimer': 0,
'parentGroupId': '',
'autoSendInviteV4': true,
'comment': ''
}
}
}
}
},
"application/xml": {
"schema": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "Title of the group",
"example": "Test Group"
},
"participants": {
"type": "string",
"description": "Participants in Array",
"example": ["[email protected]","[email protected]"]
},
"options": {
"type": "object",
"description": "Optional params",
"example": {
'messageTimer': 0,
'parentGroupId': '',
'autoSendInviteV4': true,
'comment': ''
}
}
}
}
}
}
}
}
},
"/client/getBlockedContacts/{sessionId}": {
Expand Down Expand Up @@ -7559,4 +7618,4 @@
}
}
}
}
}
Loading