From a6504366b44aca18ca3bc13dfef3c3005e40b4e1 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 15 Feb 2022 14:34:40 +0100 Subject: [PATCH] Fix to display message in toast when user is forbidden to do something Translation does not work --- .../ChillMainBundle/Resources/public/lib/api/apiMethods.js | 6 ++---- src/Bundle/ChillPersonBundle/translations/validators.fr.yml | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.js b/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.js index 7a4a81248..f761d4274 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.js +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.js @@ -21,9 +21,7 @@ const makeFetch = (method, url, body) => { } if (response.status === 403) { - return response.json().then(() => { - throw AccessException(); - }); + throw AccessException(); } throw { @@ -95,7 +93,7 @@ const ValidationException = (response) => { const AccessException = () => { const error = {}; error.name = 'AccessException'; - error.violations = ['You are no longer permitted to perform this action']; + error.violations = ['You are not allowed to perform this action']; return error; } diff --git a/src/Bundle/ChillPersonBundle/translations/validators.fr.yml b/src/Bundle/ChillPersonBundle/translations/validators.fr.yml index 56e165679..452365c4c 100644 --- a/src/Bundle/ChillPersonBundle/translations/validators.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/validators.fr.yml @@ -20,6 +20,7 @@ Two addresses has the same validFrom date: La date de validité est identique à The firstname cannot be empty: Le prénom ne peut pas être vide The lastname cannot be empty: Le nom de famille ne peut pas être vide The gender must be set: Le genre doit être renseigné +You are not allowed to perform this action: Vous n'avez pas le droit de changer cette valeur. #export list You must select at least one element: Vous devez sélectionner au moins un élément