Browse Source

fix: able to search link now

JustSong 2 years ago
parent
commit
7185490ba9
1 changed files with 3 additions and 0 deletions
  1. 3 0
      controller/webhook.go

+ 3 - 0
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{