From f8f65bd40fb2cf8473feddd057d441c9c28dbbaa Mon Sep 17 00:00:00 2001 From: Sylvain Jermini Date: Sun, 11 Jan 2015 19:06:32 +0100 Subject: [PATCH] #29 urlencode the promo code --- src/main/webapp/resources/js/admin/service/service.js | 2 +- src/main/webapp/resources/js/event/show-event.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/resources/js/admin/service/service.js b/src/main/webapp/resources/js/admin/service/service.js index b31f75595c..a213e3f4a3 100644 --- a/src/main/webapp/resources/js/admin/service/service.js +++ b/src/main/webapp/resources/js/admin/service/service.js @@ -179,7 +179,7 @@ return $http['post']('/admin/api/events/' + eventId + '/promo-code', promoCode).error(HttpErrorHandler.handle); }, remove: function(eventId, promoCode) { - return $http['delete']('/admin/api/events/' + eventId + '/promo-code/' + promoCode).error(HttpErrorHandler.handle); + return $http['delete']('/admin/api/events/' + eventId + '/promo-code/' + encodeURIComponent(promoCode)).error(HttpErrorHandler.handle); }, list: function(eventId) { return $http.get('/admin/api/events/' + eventId + '/promo-code').error(HttpErrorHandler.handle); diff --git a/src/main/webapp/resources/js/event/show-event.js b/src/main/webapp/resources/js/event/show-event.js index bde352e79d..affb6d78f9 100644 --- a/src/main/webapp/resources/js/event/show-event.js +++ b/src/main/webapp/resources/js/event/show-event.js @@ -20,7 +20,7 @@ $('#error-code-not-found').addClass('hidden'); if(promoCodeVal != null && promoCodeVal.trim() != "") { jQuery.ajax({ - url: 'promoCode/'+promoCodeVal, + url: 'promoCode/'+encodeURIComponent(promoCodeVal), type: 'POST', data: frm.serialize(), success: function(result) {