diff options
Diffstat (limited to 'internal/api/client/search/search.go')
-rw-r--r-- | internal/api/client/search/search.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/api/client/search/search.go b/internal/api/client/search/search.go index 219e30280..d413aff91 100644 --- a/internal/api/client/search/search.go +++ b/internal/api/client/search/search.go @@ -21,12 +21,12 @@ import ( "net/http" "github.com/gin-gonic/gin" + apiutil "github.com/superseriousbusiness/gotosocial/internal/api/util" "github.com/superseriousbusiness/gotosocial/internal/processing" ) const ( - BasePathV1 = "/v1/search" // Base path for serving v1 of the search API, minus the 'api' prefix. - BasePathV2 = "/v2/search" // Base path for serving v2 of the search API, minus the 'api' prefix. + BasePath = "/:" + apiutil.APIVersionKey + "/search" ) type Module struct { @@ -40,6 +40,5 @@ func New(processor *processing.Processor) *Module { } func (m *Module) Route(attachHandler func(method string, path string, f ...gin.HandlerFunc) gin.IRoutes) { - attachHandler(http.MethodGet, BasePathV1, m.SearchGETHandler) - attachHandler(http.MethodGet, BasePathV2, m.SearchGETHandler) + attachHandler(http.MethodGet, BasePath, m.SearchGETHandler) } |