FIX: webhook is already resolved
This commit is contained in:
parent
06fe17115b
commit
cc31287692
|
@ -13,14 +13,14 @@
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
export type WebhookRecievedCallback = (webhookId: string, webhook: Promise<any>) => void;
|
export type WebhookRecievedCallback = (webhookId: string, webhook: any) => void;
|
||||||
|
|
||||||
export function setupWebhookRoutes(router:any, webhookRecievedCallback:WebhookRecievedCallback):void {
|
export function setupWebhookRoutes(router:any, webhookRecievedCallback:WebhookRecievedCallback):void {
|
||||||
|
|
||||||
router.post('/webhook/:webhook', (req: any, res: any) => {
|
router.post('/webhook/:webhook', (req: any, res: any) => {
|
||||||
const webhookId = req.params.webhook;
|
const webhookId = req.params.webhook;
|
||||||
console.log("[WEB] Recieved webhook " + webhookId);
|
console.log("[WEB] Recieved webhook " + webhookId);
|
||||||
webhookRecievedCallback(webhookId, res.body);
|
webhookRecievedCallback(webhookId, req.body);
|
||||||
res.statusCode = 200;
|
res.statusCode = 200;
|
||||||
res.end();
|
res.end();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue