-
Notifications
You must be signed in to change notification settings - Fork 9
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
TreatmentPrescription bulk delete endpoint + tests (PLAN-1504) #1670
Conversation
@@ -138,6 +138,12 @@ class Meta: | |||
) | |||
|
|||
|
|||
class TreatmentPrescriptionBatchDeleteSerializer(serializers.Serializer): | |||
stand_ids = serializers.ListField( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much nicer!
delete_result = TreatmentPrescription.objects.filter( | ||
stand_id__in=stand_ids, treatment_plan_id=tx_plan_pk | ||
).delete() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a product question to do to Jordan: in other endpoints we record an actstream about deletions. Should we log this interaction as well?
If the answer is yes, then the actstrem format is a bit different, but it should be possible to log it with a method on our service module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just a question that can be addressed in a separate PR!
Per discussion, we changed this to accept stand_ids instead of ids, since that's preferable for FE needs.