Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed image metadata update endpoint to have opusId parameter #43

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Changed image metadata update endpoint to have opusId parameter
  • Loading branch information
jack-brinkman committed Dec 12, 2023
commit 9ccefbf83efce23a4d79eb6c6193041a7c4a0b93
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
Original file line number Diff line number Diff line change
@@ -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
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
@@ -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"]