|
@@ -70,6 +70,9 @@ module.exports = (crowi) => {
|
|
|
RelationTest: [
|
|
RelationTest: [
|
|
|
body('slackappintegrationsId').isMongoId(),
|
|
body('slackappintegrationsId').isMongoId(),
|
|
|
],
|
|
],
|
|
|
|
|
+ deleteIntegration: [
|
|
|
|
|
+ query('integrationIdToDelete').isMongoId(),
|
|
|
|
|
+ ],
|
|
|
SlackChannel: [
|
|
SlackChannel: [
|
|
|
body('channel').trim().not().isEmpty()
|
|
body('channel').trim().not().isEmpty()
|
|
|
.isString(),
|
|
.isString(),
|
|
@@ -406,11 +409,11 @@ module.exports = (crowi) => {
|
|
|
* 200:
|
|
* 200:
|
|
|
* description: Succeeded to delete access tokens for slack
|
|
* description: Succeeded to delete access tokens for slack
|
|
|
*/
|
|
*/
|
|
|
- router.delete('/slack-app-integration', validator.AccessTokens, apiV3FormValidator, async(req, res) => {
|
|
|
|
|
|
|
+ router.delete('/slack-app-integration', validator.deleteIntegration, apiV3FormValidator, async(req, res) => {
|
|
|
const SlackAppIntegration = mongoose.model('SlackAppIntegration');
|
|
const SlackAppIntegration = mongoose.model('SlackAppIntegration');
|
|
|
- const { tokenGtoP, tokenPtoG } = req.query;
|
|
|
|
|
|
|
+ const { integrationIdToDelete } = req.query;
|
|
|
try {
|
|
try {
|
|
|
- const response = await SlackAppIntegration.findOneAndDelete({ tokenGtoP, tokenPtoG });
|
|
|
|
|
|
|
+ const response = await SlackAppIntegration.findOneAndDelete({ _id: integrationIdToDelete });
|
|
|
return res.apiv3({ response });
|
|
return res.apiv3({ response });
|
|
|
}
|
|
}
|
|
|
catch (error) {
|
|
catch (error) {
|