Skip to content

Commit

Permalink
Merge pull request #43 from AtlasOfLivingAustralia/hotfix/5.2.1
Browse files Browse the repository at this point in the history
Changed image metadata update endpoint to have opusId parameter
  • Loading branch information
jack-brinkman authored Dec 12, 2023
2 parents 43faf7f + 9ccefbf commit d93511c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions grails-app/controllers/au/org/ala/profile/UrlMappings.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"]
Expand Down

0 comments on commit d93511c

Please sign in to comment.