Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add an ability to delete personal account gf-146 #185

Merged
merged 25 commits into from
Sep 6, 2024

Conversation

HoroshkoMykhailo
Copy link
Contributor

@HoroshkoMykhailo HoroshkoMykhailo commented Sep 4, 2024

Summary:

  • Added column deleted_at in table users for soft delete.
  • Added an ability to soft delete Personal Account .
  • Created a component and confirmation modal for Account Delete.
  • Upon confirmation, user is logged out and redirected to the Sign In page.

image

image

  • When user attempt to log in with deleted account it result in "Invalid credentials" toast notification.
  • When user attempt to sign up using the same email it result in "Email already in use" toast notification because there can`t be two records with the same email in database.

}

.divider {
width: 800px;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Avoid strict width and height, use max-width or min-width.

@@ -2,6 +2,7 @@ const NotificationMessage = {
PROJECT_CREATE_SUCCESS: "Project was successfully created",
PROJECT_UPDATE_SUCCESS: "Project was successfully updated.",
SUCCESS_PROFILE_UPDATE: "Successfully updated profile information.",
SUCCESS_USER_DELETE: "User deleted successfully.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should agree how to name this messages, because they are written in different patterns here.

Comment on lines 5 to 6

type ConfirmationModalProperties = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It is better to follow the same code style and simply write Properties

@Fjortis
Copy link
Collaborator

Fjortis commented Sep 4, 2024

I noticed the title in modal is not aligned properly like in the Figma design, this is a problem in the Modal component itself.
Perhaps you could asjust it so that it matches the design.
image

.whereNull("deletedAt")
.execute();

return numberDeletedRows > NOTHING_DELETED_COUNT;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return numberDeletedRows > NOTHING_DELETED_COUNT;
return Boolean(numberDeletedRows);

public delete(): ReturnType<Repository["delete"]> {
return Promise.resolve(true);
public async delete(id: number): Promise<boolean> {
const numberDeletedRows = await this.userModel
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const numberDeletedRows = await this.userModel
const deletedRowsCount = await this.userModel

@what1s1ove what1s1ove merged commit 7fb5001 into main Sep 6, 2024
6 checks passed
@github-actions github-actions bot mentioned this pull request Sep 6, 2024
@github-actions github-actions bot mentioned this pull request Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

6 participants