From 2fbc7cca000e682f37a39e536d74c75a9ddb4c26 Mon Sep 17 00:00:00 2001 From: elisa lee Date: Wed, 6 Dec 2023 12:30:07 -0600 Subject: [PATCH] Prevent saving of null TestResultDelivery pref (#7018) --- .../simplereport/api/queue/QueueMutationResolver.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/gov/cdc/usds/simplereport/api/queue/QueueMutationResolver.java b/backend/src/main/java/gov/cdc/usds/simplereport/api/queue/QueueMutationResolver.java index bba643dc1c..89af891a05 100644 --- a/backend/src/main/java/gov/cdc/usds/simplereport/api/queue/QueueMutationResolver.java +++ b/backend/src/main/java/gov/cdc/usds/simplereport/api/queue/QueueMutationResolver.java @@ -73,7 +73,9 @@ public String addPatientToQueue( symptomOnset, noSymptoms); - personService.updateTestResultDeliveryPreference(patientId, testResultDelivery); + if (testResultDelivery != null) { + personService.updateTestResultDeliveryPreference(patientId, testResultDelivery); + } return to.getInternalId() .toString(); // this return is unused in the UI. it used to be PatientLinkInternalId @@ -99,6 +101,8 @@ public void updateTimeOfTestQuestions( testOrderService.updateTimeOfTestQuestions( patientId, pregnancy, symptomsMap, symptomOnset, noSymptoms, genderOfSexualPartners); - personService.updateTestResultDeliveryPreference(patientId, testResultDelivery); + if (testResultDelivery != null) { + personService.updateTestResultDeliveryPreference(patientId, testResultDelivery); + } } }