fix: manually delete user when invite could not be consumed - since transactions in the handler are not yet supported

This commit is contained in:
2026-08-31 21:31:53 +02:00
parent 4b91e7b32c
commit 8479b8ac4b
3 changed files with 36 additions and 3 deletions
+12
View File
@@ -40,6 +40,18 @@ func (r *UserRepo) CreateUser(ctx context.Context, email string, name string, pa
return user, nil
}
func (r *UserRepo) DeleteUser(ctx context.Context, userID string) error {
_, err := r.db.ExecContext(ctx,
"DELETE FROM users WHERE id = $1",
userID,
)
if err != nil {
return fmt.Errorf("failed to delete user: %w", err)
}
return nil
}
func (r *UserRepo) ChangePassword(ctx context.Context, userID string, passwordHash string) error {
_, err := r.db.ExecContext(ctx,
"UPDATE users SET password_hash = $1 WHERE id = $2",