diff --git a/backend/internal/handlers/global_state.go b/backend/internal/handlers/global_state.go index 0f3fcc0..011d578 100644 --- a/backend/internal/handlers/global_state.go +++ b/backend/internal/handlers/global_state.go @@ -33,6 +33,7 @@ type GlobalState interface { // SignCollection(c *fiber.Ctx) error // To sign a collection GetButtonCount(c *fiber.Ctx) error // For demonstration purposes IncrementButtonCount(c *fiber.Ctx) error // For demonstration purposes + ListAllUsers(c *fiber.Ctx) error // To get a list of all users in the application database } // "Constructor" @@ -180,3 +181,14 @@ func (gs *GState) GetUserProjects(c *fiber.Ctx) error { // Return a json serialized list of projects return c.JSON(projects) } + +func (gs *GState) ListAllUsers(c *fiber.Ctx) error { + // Get all users from the database + users, err := gs.Db.GetAllUsersApplication() + if err != nil { + return c.Status(500).SendString(err.Error()) + } + + // Return the list of users as JSON + return c.JSON(users) +}