deleçao de contas web
This commit is contained in:
@@ -82,6 +82,11 @@ func (s *Store) SetWebAccountPassword(ctx context.Context, id int64, passwordHas
|
||||
WHERE id = $1`, id, passwordHash))
|
||||
}
|
||||
|
||||
// DeleteWebAccount apaga a conta; as sessões vão junto e a auditoria mantém o nome (migration 00003).
|
||||
func (s *Store) DeleteWebAccount(ctx context.Context, id int64) error {
|
||||
return expectOne(s.pool.Exec(ctx, `DELETE FROM web_accounts WHERE id = $1`, id))
|
||||
}
|
||||
|
||||
func (s *Store) CountActiveOwners(ctx context.Context) (int, error) {
|
||||
var n int
|
||||
err := s.pool.QueryRow(ctx, `SELECT count(*) FROM web_accounts WHERE role = 'owner' AND disabled_at IS NULL`).Scan(&n)
|
||||
|
||||
Reference in New Issue
Block a user