You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
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.
The text was updated successfully, but these errors were encountered:
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:
removeSubscription
method in the service.userId
.subscriptions
list.NotFoundException
.NotFoundException
.The text was updated successfully, but these errors were encountered: