diff --git a/src/main/java/edu/harvard/iq/dataverse/api/DatasetFieldServiceApi.java b/src/main/java/edu/harvard/iq/dataverse/api/DatasetFieldServiceApi.java index e93369b65ed..26b720d371f 100644 --- a/src/main/java/edu/harvard/iq/dataverse/api/DatasetFieldServiceApi.java +++ b/src/main/java/edu/harvard/iq/dataverse/api/DatasetFieldServiceApi.java @@ -186,14 +186,17 @@ public Response showControlledVocabularyForSubject() { @GET @Path("loadNAControlledVocabularyValue") - public void loadNAControlledVocabularyValue() { + public Response loadNAControlledVocabularyValue() { // the find will throw a javax.persistence.NoResultException if no values are in db try { datasetFieldService.findNAControlledVocabularyValue(); + return okResponse("NA value exists."); + } catch (Exception e) { ControlledVocabularyValue naValue = new ControlledVocabularyValue(); naValue.setStrValue(DatasetField.NA_VALUE); datasetFieldService.save(naValue); + return okResponse("NA value created."); } }