From e8ac8f38d11c482b296c60ebb28d9e5618b9280a Mon Sep 17 00:00:00 2001 From: Albin Antony Date: Thu, 26 Oct 2023 18:54:57 +0530 Subject: [PATCH] Fix #381 Failed to fetch webhook id by webhook dispatcher --- resources/config | 2 +- src/v2/webhook_dispatcher/db.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/config b/resources/config index c3a4f09..9a0e05e 160000 --- a/resources/config +++ b/resources/config @@ -1 +1 @@ -Subproject commit c3a4f09ef85e32fc95cc4735ab168a5a009e7284 +Subproject commit 9a0e05ef000491b8790e7615aaac653b0a803aa1 diff --git a/src/v2/webhook_dispatcher/db.go b/src/v2/webhook_dispatcher/db.go index b68e356..2d17686 100644 --- a/src/v2/webhook_dispatcher/db.go +++ b/src/v2/webhook_dispatcher/db.go @@ -18,7 +18,11 @@ func webhookDeliveryCollection() *mongo.Collection { } // GetWebhookByOrgID Gets a webhook by organisation ID and webhook ID -func GetWebhookByOrgID(webhookId, orgID string) (result Webhook, err error) { +func GetWebhookByOrgID(webhookID, orgID string) (result Webhook, err error) { + webhookId, err := primitive.ObjectIDFromHex(webhookID) + if err != nil { + return result, err + } err = webhookCollection().FindOne(context.TODO(), bson.M{"_id": webhookId, "orgid": orgID}).Decode(&result)