From a2bc4d4b1d98cb103706c49e1c357a3407b6c23b Mon Sep 17 00:00:00 2001 From: GPortas Date: Sun, 9 Jul 2023 15:47:08 +0100 Subject: [PATCH] Removed: not essential findDataFileOrDie call to avoid extra query --- src/main/java/edu/harvard/iq/dataverse/api/Files.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/api/Files.java b/src/main/java/edu/harvard/iq/dataverse/api/Files.java index d4bf28482c9..714a08f4d2c 100644 --- a/src/main/java/edu/harvard/iq/dataverse/api/Files.java +++ b/src/main/java/edu/harvard/iq/dataverse/api/Files.java @@ -827,14 +827,8 @@ public Response getFixityAlgorithm() { @GET @Path("{id}/guestbookResponses/count") - public Response getCountGuestbookResponses(@PathParam("id") String dataFileId) { - DataFile dataFile; - try { - dataFile = findDataFileOrDie(dataFileId); - } catch (WrappedResponse wr) { - return wr.getResponse(); - } - return ok(guestbookResponseService.getCountGuestbookResponsesByDataFileId(dataFile.getId()).toString()); + public Response getCountGuestbookResponses(@PathParam("id") long dataFileId) { + return ok(guestbookResponseService.getCountGuestbookResponsesByDataFileId(dataFileId).toString()); } @GET