From 9ccefbf83efce23a4d79eb6c6193041a7c4a0b93 Mon Sep 17 00:00:00 2001 From: Jack Brinkman Date: Tue, 12 Dec 2023 10:57:26 +1000 Subject: [PATCH] Changed image metadata update endpoint to have opusId parameter --- gradle.properties | 2 +- .../controllers/au/org/ala/profile/ImageController.groovy | 5 +++-- .../controllers/au/org/ala/profile/UrlMappings.groovy | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 76d5ba4b..ab75dd37 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -profileServiceVersion=5.2 +profileServiceVersion=5.2.1-SNAPSHOT grailsVersion=5.2.4 gorm.version=7.3.2 groovyVersion=3.0.11 diff --git a/grails-app/controllers/au/org/ala/profile/ImageController.groovy b/grails-app/controllers/au/org/ala/profile/ImageController.groovy index 107b0a5d..08e018f6 100644 --- a/grails-app/controllers/au/org/ala/profile/ImageController.groovy +++ b/grails-app/controllers/au/org/ala/profile/ImageController.groovy @@ -18,9 +18,10 @@ class ImageController extends BaseController { def updateMetadata() { String imageId = params.imageId + String opusId = params.opusId final metadata = request.getJSON() - if (!imageId || !metadata) { - badRequest "imageId and request body are required parameters" + if (!opusId || !imageId || !metadata) { + badRequest "opusId, imageId and request body are required parameters" } else { def image = localImageService.updateMetadata(imageId, metadata) render image as JSON diff --git a/grails-app/controllers/au/org/ala/profile/UrlMappings.groovy b/grails-app/controllers/au/org/ala/profile/UrlMappings.groovy index 411899ae..2b380d5f 100644 --- a/grails-app/controllers/au/org/ala/profile/UrlMappings.groovy +++ b/grails-app/controllers/au/org/ala/profile/UrlMappings.groovy @@ -118,6 +118,9 @@ class UrlMappings { "/opus/$opusId/restore/$profileId" controller: "profile", action: [POST: "restoreArchivedProfile"] "/opus/$opusId/reindex" controller: "opus", action: [POST: "reindex"] + "/opus/$opusId/image/$imageId/metadata" controller: "image", action: [GET: "getImageInfo", POST: "updateMetadata"] + "/image/$imageId" controller: "image", action: [GET: "getImageInfo"] + "/checkName" controller: "profile", action: [GET: "checkName"] "/report/archivedProfiles" controller: "report", action: [GET: "archivedProfiles"] @@ -131,9 +134,6 @@ class UrlMappings { "/job/$jobType" controller: "job", action: [GET: "listAllPendingJobs", PUT: "createJob"] "/job/" controller: "job", action: [GET: "listAllPendingJobs", PUT: "createJob"] - "/image/$imageId" controller: "image", action: [GET: "getImageInfo"] - "/image/$imageId/metadata" controller: "image", action: [GET: "getImageInfo", POST: "updateMetadata"] - "/statistics/" controller: "statistics", action: [GET: "index"] "/import/profile" controller: "import", action: [POST: "profile"]