This commit is contained in:
lbenedar
2026-03-06 15:37:31 +03:00
parent b6cdb2b860
commit 126ccfa715
5 changed files with 49 additions and 11 deletions

View File

@@ -69,5 +69,11 @@ func (m *UserModel) Authenticate(email, password string) (int, error) {
}
func (m *UserModel) Exists(id int) (bool, error) {
return false, nil
var exists bool
stmt := `SELECT EXISTS(SELECT true FROM users WHERE id = ?)`
err := m.DB.QueryRow(stmt, id).Scan(&exists)
return exists, err
}