Bug 33817: (follow-up) Fix spec and messages

This patch should resolve the issues highlighted at signoff time by
Victor.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 34b704fb0b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ba57a9aa58)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
Martin Renvoize 2023-06-27 12:03:58 +01:00 committed by Matt Blenkinsop
parent 9e71c42a1e
commit 4a8f592802
2 changed files with 9 additions and 1 deletions

View file

@ -258,6 +258,10 @@
description: Bad parameter
schema:
$ref: "../swagger.yaml#/definitions/error"
"409":
description: Conflict in creating resource
schema:
$ref: "../swagger.yaml#/definitions/error"
"401":
description: Authentication required
schema:

View file

@ -1806,6 +1806,8 @@
var response = data.responseJSON;
if ( response.error_code === 'already_bundled' ) {
$('#addResult').replaceWith('<div id="addResult" class="alert alert-warning">'+_("Warning: Item '%s' already attached").format(barcode)+'</div>');
} else if (response.error_code === 'bundle_checkout_out') {
$('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Bundle is currently checked out")+'</div>');
} else if (response.error_code === 'checked_out') {
const button = $('<button type="button">')
.addClass('btn btn-xs')
@ -1907,7 +1909,9 @@
var barcode = $('#rm_external_id').val();
if ( data.status === 409 ) {
var response = data.responseJSON;
if ( response.key === "PRIMARY" ) {
if (response.error_code === 'bundle_checkout_out') {
$('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Bundle is currently checked out")+'</div>');
} else if ( response.key === "PRIMARY" ) {
$('#removeResult').replaceWith('<div id="removeResult" class="alert alert-warning">'+_("Warning: Item '%s' already attached").format(barcode)+'</div>');
} else {
$('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'</div>');