From 7817818bd0fa1a47af17ff49b7fb77974fdcaaec Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Sat, 1 Apr 2023 17:56:29 +0800 Subject: [PATCH] fix(nocodb): return axios response --- packages/nocodb/src/lib/plugins/discord/Discord.ts | 2 +- packages/nocodb/src/lib/plugins/mattermost/Mattermost.ts | 2 +- packages/nocodb/src/lib/plugins/slack/Slack.ts | 2 +- packages/nocodb/src/lib/plugins/teams/Teams.ts | 2 +- .../src/lib/v1-legacy/plugins/adapters/discord/Discord.ts | 2 +- .../src/lib/v1-legacy/plugins/adapters/mattermost/Mattermost.ts | 2 +- .../nocodb/src/lib/v1-legacy/plugins/adapters/slack/Slack.ts | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/nocodb/src/lib/plugins/discord/Discord.ts b/packages/nocodb/src/lib/plugins/discord/Discord.ts index c127e235e5..a83f522503 100644 --- a/packages/nocodb/src/lib/plugins/discord/Discord.ts +++ b/packages/nocodb/src/lib/plugins/discord/Discord.ts @@ -9,7 +9,7 @@ export default class Discord implements IWebhookNotificationAdapter { public async sendMessage(content: string, payload: any): Promise { for (const { webhook_url } of payload?.channels) { try { - await axios.post(webhook_url, { + return await axios.post(webhook_url, { content, }); } catch (e) { diff --git a/packages/nocodb/src/lib/plugins/mattermost/Mattermost.ts b/packages/nocodb/src/lib/plugins/mattermost/Mattermost.ts index 19009c1bec..65bfa902b7 100644 --- a/packages/nocodb/src/lib/plugins/mattermost/Mattermost.ts +++ b/packages/nocodb/src/lib/plugins/mattermost/Mattermost.ts @@ -9,7 +9,7 @@ export default class Mattermost implements IWebhookNotificationAdapter { public async sendMessage(text: string, payload: any): Promise { for (const { webhook_url } of payload?.channels) { try { - await axios.post(webhook_url, { + return await axios.post(webhook_url, { text, }); } catch (e) { diff --git a/packages/nocodb/src/lib/plugins/slack/Slack.ts b/packages/nocodb/src/lib/plugins/slack/Slack.ts index 73dcf114d6..2e2ebcf0dc 100644 --- a/packages/nocodb/src/lib/plugins/slack/Slack.ts +++ b/packages/nocodb/src/lib/plugins/slack/Slack.ts @@ -9,7 +9,7 @@ export default class Slack implements IWebhookNotificationAdapter { public async sendMessage(text: string, payload: any): Promise { for (const { webhook_url } of payload?.channels) { try { - await axios.post(webhook_url, { + return await axios.post(webhook_url, { text, }); } catch (e) { diff --git a/packages/nocodb/src/lib/plugins/teams/Teams.ts b/packages/nocodb/src/lib/plugins/teams/Teams.ts index d60a0a5d00..868d7d5aa2 100644 --- a/packages/nocodb/src/lib/plugins/teams/Teams.ts +++ b/packages/nocodb/src/lib/plugins/teams/Teams.ts @@ -9,7 +9,7 @@ export default class Teams implements IWebhookNotificationAdapter { public async sendMessage(Text: string, payload: any): Promise { for (const { webhook_url } of payload?.channels) { try { - await axios.post(webhook_url, { + return await axios.post(webhook_url, { Text, }); } catch (e) { diff --git a/packages/nocodb/src/lib/v1-legacy/plugins/adapters/discord/Discord.ts b/packages/nocodb/src/lib/v1-legacy/plugins/adapters/discord/Discord.ts index 6e73a3dd2a..310e97dd4c 100644 --- a/packages/nocodb/src/lib/v1-legacy/plugins/adapters/discord/Discord.ts +++ b/packages/nocodb/src/lib/v1-legacy/plugins/adapters/discord/Discord.ts @@ -9,7 +9,7 @@ export default class Discord { ): Promise { for (const { webhook_url } of webhooks) { try { - await axios.post(webhook_url, { + return await axios.post(webhook_url, { content, }); } catch (e) { diff --git a/packages/nocodb/src/lib/v1-legacy/plugins/adapters/mattermost/Mattermost.ts b/packages/nocodb/src/lib/v1-legacy/plugins/adapters/mattermost/Mattermost.ts index 66f311a31a..fa0a08ef5f 100644 --- a/packages/nocodb/src/lib/v1-legacy/plugins/adapters/mattermost/Mattermost.ts +++ b/packages/nocodb/src/lib/v1-legacy/plugins/adapters/mattermost/Mattermost.ts @@ -9,7 +9,7 @@ export default class Mattermost { ): Promise { for (const { webhook_url } of webhooks) { try { - await axios.post(webhook_url, { + return await axios.post(webhook_url, { text, }); } catch (e) { diff --git a/packages/nocodb/src/lib/v1-legacy/plugins/adapters/slack/Slack.ts b/packages/nocodb/src/lib/v1-legacy/plugins/adapters/slack/Slack.ts index 12732dc3f8..5e4097c70d 100644 --- a/packages/nocodb/src/lib/v1-legacy/plugins/adapters/slack/Slack.ts +++ b/packages/nocodb/src/lib/v1-legacy/plugins/adapters/slack/Slack.ts @@ -9,7 +9,7 @@ export default class Slack { ): Promise { for (const { webhook_url } of webhooks) { try { - await axios.post(webhook_url, { + return await axios.post(webhook_url, { text, }); } catch (e) {