diff --git a/handler/users.go b/handler/users.go index bad5505..e3e62e7 100644 --- a/handler/users.go +++ b/handler/users.go @@ -48,7 +48,7 @@ func (h *Handler) GetUserBatch(c echo.Context) error { return c.NoContent(http.StatusBadRequest) } - h.DB.Find(&users, ids) + h.DB.Omit("Password").Find(&users, ids) return c.JSON(http.StatusOK, users) } @@ -60,7 +60,7 @@ func (h *Handler) GetUser(c echo.Context) error { return c.NoContent(http.StatusBadRequest) } - tx := h.DB.Preload("Position").Where("id = ?", id).Find(&user) + tx := h.DB.Preload("Position").Omit("Password").Where("id = ?", id).Find(&user) if tx.RowsAffected == 0 { return c.NoContent(http.StatusNotFound) diff --git a/test.db b/test.db index d3cb85d..484e84e 100644 Binary files a/test.db and b/test.db differ