Commit 1c2df321 authored by bensinober's avatar bensinober Committed by Benjamin
Browse files

DEICH-5652 add error message on to many reserves for publication

parent d3ccc67b
......@@ -7,6 +7,8 @@ export default {
reservation: {
TOO_MANY_RESERVES: "Du har nådd maks antall bestillinger.",
TOO_MANY_RESERVES_FOR_THIS_RECORD: "Ikke mulig å bestille. Du har allerede bestilt denne.",
NO_RESERVES_FOR_THIS_RECORD: "Ikke mulig å bestille.",
AGE_RESTRICTION: "Du er dessverre ikke gammel nok til å låne denne.",
DISALLOWED_FORMAT: "Dette materialet kan ikke bestilles.",
......@@ -415,6 +415,10 @@ export function reservePublication(recordId, branchCode) {
throw Error(Errors.reservation.AGE_RESTRICTION);
} else if (response.error.includes("tooManyHolds")) {
throw Error(Errors.reservation.TOO_MANY_RESERVES);
} else if (response.error.includes("tooManyHoldsForThisRecord")) {
throw Error(Errors.reservation.TOO_MANY_RESERVES_FOR_THIS_RECORD);
} else if (response.error.includes("noHoldsForThisRecord")) {
throw Error(Errors.reservation.NO_RESERVES_FOR_THIS_RECORD);
} else if (response.error.includes("disallowedFormat")) {
throw Error(Errors.reservation.DISALLOWED_FORMAT);
} else if (response.error.includes("noSkoleItems")) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment