mirror of
https://github.com/Damillora/Shioriko.git
synced 2024-12-22 16:03:45 +00:00
fix: fix route conflicts
This commit is contained in:
parent
f2c6d852a9
commit
e175d12ca7
@ -10,11 +10,14 @@ import (
|
||||
)
|
||||
|
||||
func InitializeTagRoutes(g *gin.Engine) {
|
||||
autocomplete := g.Group("/api/tag-autocomplete")
|
||||
{
|
||||
autocomplete.GET("/", tagAutocomplete)
|
||||
}
|
||||
unprotected := g.Group("/api/tag")
|
||||
{
|
||||
unprotected.GET("/", tagGet)
|
||||
unprotected.GET("/:tag", tagGetOne)
|
||||
unprotected.GET("/autocomplete", tagAutocomplete)
|
||||
}
|
||||
protected := g.Group("/api/tag").Use(middleware.AuthMiddleware())
|
||||
{
|
||||
@ -36,6 +39,7 @@ func tagGetOne(c *gin.Context) {
|
||||
Code: http.StatusBadRequest,
|
||||
Message: err.Error(),
|
||||
})
|
||||
c.Abort()
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, models.TagReadModel{
|
||||
|
@ -49,7 +49,7 @@ export async function getTag({ tag }) {
|
||||
}
|
||||
|
||||
export async function getTagAutocomplete() {
|
||||
const endpoint = url + "/api/tag/autocomplete";
|
||||
const endpoint = url + "/api/tag-autocomplete";
|
||||
const response = await axios.get(endpoint);
|
||||
return response.data;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user