Skip to content

Ajout moyen de pouvoir supprimer son compte#148

Merged
luclu7 merged 1 commit into
masterfrom
delete-account
Apr 8, 2026
Merged

Ajout moyen de pouvoir supprimer son compte#148
luclu7 merged 1 commit into
masterfrom
delete-account

Conversation

@luclu7
Copy link
Copy Markdown
Member

@luclu7 luclu7 commented Apr 8, 2026

On doit le faire avant le 14:

image

L'endpoint existe déjà côté back, juste à faire le côté client

@luclu7 luclu7 self-assigned this Apr 8, 2026
@luclu7 luclu7 requested a review from Copilot April 8, 2026 14:00
@yohann69
Copy link
Copy Markdown
Member

yohann69 commented Apr 8, 2026

On doit le faire avant le 14:

image L'endpoint existe déjà côté back, juste à faire le côté client

je crois que l'endpoint ne fonctionne pas
J'avais juste fait en prévision mais la délétion implique beaucoup trop de changements et retombées de suppressions de foreign keys (ou alors faut que j'anonymize tout mais dans tous les cas c'est pas encore fait)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the client-side “delete my account” flow in the account settings screen by wiring a new DELETE API call to a React Query mutation and exposing it via a confirmation dialog button.

Changes:

  • Add deleteAccount API endpoint and route constant for a DELETE /newf/me request.
  • Introduce useDeleteAccount hook that deletes the account then logs the user out.
  • Add DeleteAccountButton with a confirmation dialog and new i18n strings across locales.
  • (Also includes broad dependency version changes in package.json / package-lock.json.)

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/hooks/account/useDeleteAccount.ts React Query mutation for account deletion + logout on success
src/components/custom/DeleteAccountButton.tsx UI button + confirmation dialog calling the mutation
src/app/screens/account/settings/Settings.tsx Adds the delete account button to settings screen
src/api/endpoints/user/user.endpoints.ts Adds deleteAccount() API helper
src/api/common/endpoints.ts Adds deleteAccount route constant
locales/*/translation.json Adds settings.deleteAccount.* strings
package.json Updates many dependencies (unrelated to feature)
package-lock.json Lockfile churn matching dependency changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

title={t("settings.deleteAccount.title")}
className="gap-2"
cancelLabel={t("common.cancel")}
confirmLabel={t("settings.deleteAccount.confirm")}
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DialogContent supports isPending and disableConfirm for the confirm button, but they aren’t wired here. With isPending true, the dialog confirm button remains clickable and can trigger multiple DELETE requests. Pass isPending={isPending} and disable confirm while pending (e.g. disableConfirm={isPending}), and consider also passing isPending so the confirm button shows its loading state.

Suggested change
confirmLabel={t("settings.deleteAccount.confirm")}
confirmLabel={t("settings.deleteAccount.confirm")}
isPending={isPending}
disableConfirm={isPending}

Copilot uses AI. Check for mistakes.
Comment on lines 19 to 23
resendCode: "/auth/resend-code",
resetPassword: "/auth/reset-password",
changePassword: "/auth/change-password",
deleteAccount: "/newf/me",
club: "/club",
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API_ROUTES.deleteAccount is identical to API_ROUTES.user (both "/newf/me"). This duplication can drift over time; consider reusing the existing user route for the delete call (or alias deleteAccount to user) rather than defining a separate constant with the same value.

Copilot uses AI. Check for mistakes.
@luclu7 luclu7 merged commit 5059cae into master Apr 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants