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

Delete User #787

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Delete User #787

wants to merge 2 commits into from

Conversation

djale1k
Copy link
Contributor

@djale1k djale1k commented Sep 23, 2020

Pull Request Template

Description

Delete user action and all stats

Fixes #50

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A Insomnia calll
  • Test B incoming tests.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@djale1k djale1k self-assigned this Sep 23, 2020
@djale1k
Copy link
Contributor Author

djale1k commented Sep 23, 2020

@FilipNikolovski I have some questions, issue does not have documentation so maybe this is not the way we should delete user? other questions..

  1. table subscribers_segments should i first fetch * from table with segment_id before i should fetch segment ids with user id and after that delete * from sub_segments
  2. What should i do after successfully delete

err := tx.Where("user_id = ?", userID).Delete(send).Error
if err != nil {
tx.Rollback()
return err
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wrap the error with a message.

return fmt.Errorf("storage user: delete sends stat: %w", err)

@FilipNikolovski FilipNikolovski marked this pull request as draft September 23, 2020 18:43
@FilipNikolovski FilipNikolovski added this to the v1.0 milestone Sep 23, 2020
@FilipNikolovski FilipNikolovski added enhancement go Pull requests that update Go code labels Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete account
2 participants