Simplified search route
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
package search
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
@ -14,7 +16,8 @@ const maxTracks = 4
|
||||
|
||||
// Get search page.
|
||||
func Get(ctx *aero.Context) string {
|
||||
term := ctx.Query("q")
|
||||
term := ctx.Get("term")
|
||||
term = strings.TrimPrefix(term, "/")
|
||||
|
||||
users, animes, posts, threads, tracks := arn.Search(term, maxUsers, maxAnime, maxPosts, maxThreads, maxTracks)
|
||||
return ctx.HTML(components.SearchResults(term, users, animes, posts, threads, tracks))
|
||||
|
Reference in New Issue
Block a user