From 7185490ba98cbcd2b5bba89b91d2b13dea1aba51 Mon Sep 17 00:00:00 2001 From: JustSong Date: Wed, 10 May 2023 16:10:03 +0800 Subject: [PATCH] fix: able to search link now --- controller/webhook.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controller/webhook.go b/controller/webhook.go index 3f87167..f4deeb9 100644 --- a/controller/webhook.go +++ b/controller/webhook.go @@ -37,6 +37,9 @@ func GetAllWebhooks(c *gin.Context) { func SearchWebhooks(c *gin.Context) { userId := c.GetInt("id") keyword := c.Query("keyword") + if strings.HasPrefix(keyword, common.ServerAddress+"/webhook/") { + keyword = strings.TrimPrefix(keyword, common.ServerAddress+"/webhook/") + } webhooks, err := model.SearchWebhooks(userId, keyword) if err != nil { c.JSON(http.StatusOK, gin.H{