From bd9b786e3f749359d3ee7251c5835ed09cde1c68 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 10 Aug 2021 12:35:42 +0200 Subject: [PATCH] Added getUsers func --- routers/api/v1/user/user.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/routers/api/v1/user/user.go b/routers/api/v1/user/user.go index 50784bc..c2253d9 100644 --- a/routers/api/v1/user/user.go +++ b/routers/api/v1/user/user.go @@ -274,6 +274,18 @@ func DeleteUser(c *fiber.Ctx) error { return c.SendStatus(fiber.StatusOK) } +func GetUsers(c *fiber.Ctx) error { + db := database.DB + + log.Info("here") + + users := []structs.APIUser{} + + db.Model(&structs.User{}).Find(&users) + + return c.JSON(users) +} + /* func GetUsers(c *fiber.Ctx) error {