Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

delete profile and user (DRAFT IN PROGRESS) #9837

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

amandamartin-dev
Copy link
Contributor

Fixes Issue

Closes #9821

Changes proposed

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Screenshots

Note to reviewers

@eddiejaoude FYI Since I have more limited time to build, I'll push here to the PR each time I have a moment to work - if you decide you wanna get this out before I finish feel free to grab it and keep moving

@github-actions github-actions bot added the issue linked Pull Request has issue linked label Nov 25, 2023
@eddiejaoude
Copy link
Member

FYI Since I have more limited time to build, I'll push here to the PR each time I have a moment to work - if you decide you wanna get this out before I finish feel free to grab it and keep moving

Thanks Amanda! We could also break down into tasks and share if that helps? I have been thinking more about the backend part and the collections we need to delete from and the order

@amandamartin-dev
Copy link
Contributor Author

FYI Since I have more limited time to build, I'll push here to the PR each time I have a moment to work - if you decide you wanna get this out before I finish feel free to grab it and keep moving

Thanks Amanda! We could also break down into tasks and share if that helps? I have been thinking more about the backend part and the collections we need to delete from and the order

Sure! I'm driving today so won't be touching anything. I haven't started the backend yet, just drafted out the FE modal.
I think the tasks left are...
delete call
Json file check/delete?
Move the UI I made to a component (it can't use the regular card bc that's a link so I made a separate one)
Maybe a loader while deleting is happening? (Could be a separate issue)
Deletion complete message? Redirect to main page?

I'll be back on things Monday

@amandamartin-dev
Copy link
Contributor Author

amandamartin-dev commented Nov 27, 2023

Looking at the database now, it looks like to delete everything we should do it in the following order:
get username
delete links by username
if json exists, delete json by username
then delete profile - which has all events, milestones, etc

if there's anything I haven't considered, lmk

@amandamartin-dev
Copy link
Contributor Author

@eddiejaoude update started building out the API, currently it will delete all links by username (no UI indication yet that it's' happened.)

Have to step away again, may have time again this evening.

@eddiejaoude
Copy link
Member

Looking at the database now, it looks like to delete everything we should do it in the following order: get username delete links by username if json exists, delete json by username then delete profile - which has all events, milestones, etc

if there's anything I haven't considered, lmk

Looks good, also there will be the tables/collections to delete from ProfileStats and LinkStats.

Also I think we should keep a stats oof deleted profiles, we could store this in the Stats model with an increment counter. Also maybe against the User model we should store the status isDeleted: true and if they log back in and create a profile it would update this to false again?

@amandamartin-dev
Copy link
Contributor Author

@eddiejaoude
profile links and json will now delete - i stopped before doing events/,milestones/repos bc I can't remember if we still rely on the folders to load these or if the folders are just there now and should be deleted as well, but the db is where we are loading from.

So, thinking deleting the "rest" is folders then db? or other way around?

@eddiejaoude
Copy link
Member

@eddiejaoude profile links and json will now delete - i stopped before doing events/,milestones/repos bc I can't remember if we still rely on the folders to load these or if the folders are just there now and should be deleted as well, but the db is where we are loading from.

So, thinking deleting the "rest" is folders then db? or other way around?

When the data files are changed, they are all loaded into the DB, then the json files are not used to present the data in the UI. So I think we only need to delete the DB, and give them a notifications in the UI to delete their files via a PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue linked Pull Request has issue linked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Delete profile and user
2 participants