error handling for usermodel and reformatting

This commit is contained in:
yequari 2025-03-15 10:57:51 -07:00
parent adaf6cf87d
commit 2a15f4b91d

View File

@ -75,6 +75,9 @@ func (m *UserModel) GetById(id int64) (User, error) {
func (m *UserModel) GetAll() ([]User, error) {
stmt := `SELECT Id, ShortId, Username, Email, Created FROM users WHERE IsDeleted = FALSE`
rows, err := m.DB.Query(stmt)
if err != nil {
return nil, err
}
var users []User
for rows.Next() {
var u User