package routes import ( "nearle/facade" "github.com/gofiber/fiber/v2" ) func RegisterUserRoutes(api fiber.Router, f *facade.Facade) { users := api.Group("/v1/web/users") users.Get("/getallusers", f.UserController.GetAllUsers) users.Get("/getusers", f.UserController.GetUserInfo) users.Post("/applogin", f.UserController.AppLogin) users.Post("/create", f.UserController.CreateUser) users.Post("/tenant/weblogin", f.UserController.TenantWebLogin) // First password, before a session can exist. Public by necessity and safe // because of what it refuses — see userController.SetPassword. users.Post("/setpassword", f.UserController.SetPassword) users.Put("/update", f.UserController.UpdateStaff) users.Delete("/delete", f.UserController.DeleteUser) users = api.Group("/v1/mob/users") // `TenantLogin`, not `Login`. The route is named for the tenant and the app // needs the shop with it — its name, address, category, branch and the // superadmin flag — none of which `UserInfo` carries. `TenantUserInfo` now // also carries the shiftid, shiftname and status that `Login` returned, so // this response is a superset of the old one and no client loses a field. users.Post("/tenant/login", f.UserController.TenantLogin) users.Get("/getusers", f.UserController.GetUserInfo) users.Post("/create", f.UserController.CreateUser) users.Put("/update", f.UserController.UpdateStaff) }