fix: able to search link now

This commit is contained in:
JustSong
2023-05-10 16:10:03 +08:00
parent 34b9633417
commit 7185490ba9
+3
View File
@@ -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{