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

Remove Subscription #38

Open
ArslanKamchybekov opened this issue Oct 12, 2024 · 0 comments
Open

Remove Subscription #38

ArslanKamchybekov opened this issue Oct 12, 2024 · 0 comments
Assignees

Comments

@ArslanKamchybekov
Copy link
Collaborator

Task: Remove Subscription from User's Data

Objective:

You are tasked with implementing a feature to delete a subscription from a user's data. When this operation is performed, the subscription will be removed from the user's list of saved subscriptions.

Instructions:

  1. Service Method:
    • Implement the removeSubscription method in the service.
    • This method should:
      • Find the user by their userId.
      • Check if the subscription exists in the user's subscriptions list.
      • If the subscription exists, remove it from the list.
      • Save the updated user data back to the database.
      • Return the updated user data.
  2. Handle Errors:
    • If the user is not found, throw a NotFoundException.
    • If the subscription is not found in the user's data, throw a NotFoundException.
    • Log any errors for debugging purposes.
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

No branches or pull requests

3 participants