Skip to content

Commit d8a6545

Browse files
committed
fix: query for search
1 parent 5f5b6bb commit d8a6545

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

NotEnoughUpdates-REPO

docs/docs.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/swagger.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/swagger.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,9 +2246,9 @@ paths:
22462246
required: true
22472247
schema:
22482248
type: string
2249-
- description: Search string (required when inventoryId is 'search')
2249+
- description: Search query (required when inventoryId is 'search')
22502250
in: query
2251-
name: search
2251+
name: query
22522252
schema:
22532253
type: string
22542254
responses:

src/routes.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ func SetupRoutes(app *fiber.App) {
167167
api.Get("/pets/:uuid/:profileId", routes.PetsHandler)
168168

169169
api.Get("/inventory/:uuid/:profileId/:inventoryId", routes.InventoryHandler)
170-
api.Get("/inventory/:uuid/:profileId/:inventoryId/:search", routes.InventoryHandler)
171170

172171
api.Get("/skills/:uuid/:profileId", routes.SkillsHandler)
173172

src/routes/inventory.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func getIcon(source string, uuid string) string {
5353
// @Param uuid path string true "User UUID"
5454
// @Param profileId path string true "Profile ID"
5555
// @Param inventoryId path string true "Inventory ID (e.g., museum, search, or other inventory types)"
56-
// @Param search query string false "Search string (required when inventoryId is 'search')"
56+
// @Param query query string false "Search query (required when inventoryId is 'search')"
5757
// @Success 200 {object} []models.StrippedItem
5858
// @Failure 400 {object} models.ProcessingError
5959
// @Failure 500 {object} models.ProcessingError
@@ -143,7 +143,7 @@ func InventoryHandler(c *fiber.Ctx) error {
143143
}
144144
}
145145

146-
searchString := c.Params("search")
146+
searchString := c.Query("query")
147147
if searchString == "" {
148148
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
149149
"error": "Search string cannot be empty",

0 commit comments

Comments
 (0)