Skip to content

Commit b41713b

Browse files
authored
Merge pull request #4231 from nhsuk/improve-destroy-endpoint
Improve team destruction endpoint
2 parents dbbecc7 + cbddd5b commit b41713b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

app/controllers/api/testing/teams_controller.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@ def destroy
3434

3535
log_destroy(SessionDate.where(session: sessions))
3636

37-
log_destroy(SchoolMove.where(patient_id: patient_ids))
38-
log_destroy(SchoolMove.where(team:))
39-
log_destroy(SchoolMoveLogEntry.where(patient_id: patient_ids))
4037
log_destroy(AccessLogEntry.where(patient_id: patient_ids))
41-
log_destroy(NotifyLogEntry.where(patient_id: patient_ids))
38+
log_destroy(ArchiveReason.where(patient_id: patient_ids))
39+
log_destroy(ConsentNotification.where(patient_id: patient_ids))
40+
log_destroy(Note.where(patient_id: patient_ids))
4241
# In local dev we can end up with NotifyLogEntries without a patient
4342
log_destroy(NotifyLogEntry.where(patient_id: nil))
43+
log_destroy(NotifyLogEntry.where(patient_id: patient_ids))
44+
log_destroy(SchoolMove.where(patient_id: patient_ids))
45+
log_destroy(SchoolMove.where(team:))
46+
log_destroy(SchoolMoveLogEntry.where(patient_id: patient_ids))
4447
log_destroy(VaccinationRecord.where(patient_id: patient_ids))
4548

4649
log_destroy(ConsentForm.where(team:))

0 commit comments

Comments
 (0)