浏览代码

fix: able to search link now

JustSong 2 年之前
父节点
当前提交
7185490ba9
共有 1 个文件被更改,包括 3 次插入0 次删除
  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{