func (d Dao) Delete(ctx context.Context, u User) error {
	if _, err := d.Login(ctx, u); err != nil {
		if errors.Is(err, ErrIncorrectLogin) {
			return ErrIncorrectLogin
		}
		return fmt.Errorf("checking password: %w", err)
	}
	q := db.NewExecFunction("user_delete", u.Username)
	if err := d.db.Exec(ctx, q); err != nil {
		return fmt.Errorf("deleting user: %w", err)
	}
	return nil
}
// Delete removes a user.
Delete removes a user.
// Delete removes a user .
func (d Dao) Delete(ctx context.Context, u User) error {
	if _, err := d.Login(ctx, u); err != nil {
		if errors.Is(err, ErrIncorrectLogin) {
			return ErrIncorrectLogin
		}
		return fmt.Errorf("checking password: %w", err)
	}
	q := db.NewExecFunction("user_delete", u.Username)
	if err := d.db.Exec(ctx, q); err != nil {
		return fmt.Errorf("deleting user: %w", err)
	}
	return nil
}
func ( d Dao ) Delete ( ctx context . Context , u User ) error { if _ , err := d . Login ( ctx , u ) ; err != nil { if errors . Is ( err , ErrIncorrectLogin ) { return ErrIncorrectLogin } return fmt . Errorf ( " " , err ) } q := db . NewExecFunction ( " " , u . Username ) if err := d . db . Exec ( ctx , q ) ; err != nil { return fmt . Errorf ( " " , err ) } return nil }
Delete removes a user.
Delete removes a user .