diff --git a/pkg/internal/server/api/index.go b/pkg/internal/server/api/index.go index 6cf84df..a1346c6 100644 --- a/pkg/internal/server/api/index.go +++ b/pkg/internal/server/api/index.go @@ -7,13 +7,13 @@ import ( func MapAPIs(app *fiber.App, baseURL string) { api := app.Group(baseURL).Name("API") { - wallet := api.Group("/wallet").Name("Wallet API") + wallet := api.Group("/wallets").Name("Wallet API") { wallet.Post("/me", createWallet) wallet.Get("/me", getMyWallet) } - transaction := api.Group("/transaction").Name("Transaction API") + transaction := api.Group("/transactions").Name("Transaction API") { transaction.Get("/me", getTransaction) transaction.Get("/:id", getTransactionByID) diff --git a/pkg/internal/server/api/transaction_api.go b/pkg/internal/server/api/transaction_api.go index bcbcdd8..368b883 100644 --- a/pkg/internal/server/api/transaction_api.go +++ b/pkg/internal/server/api/transaction_api.go @@ -14,7 +14,7 @@ func getTransaction(c *fiber.Ctx) error { if err := sec.EnsureAuthenticated(c); err != nil { return err } - user := c.Locals("user").(*sec.UserInfo) + user := c.Locals("nex_user").(*sec.UserInfo) var wallet models.Wallet if err := database.C.Where("account_id = ?", user.ID).First(&wallet).Error; err != nil { @@ -46,7 +46,7 @@ func getTransactionByID(c *fiber.Ctx) error { if err := sec.EnsureAuthenticated(c); err != nil { return err } - user := c.Locals("user").(*sec.UserInfo) + user := c.Locals("nex_user").(*sec.UserInfo) var transaction models.Transaction if err := database.C.Where("id = ?", id).