Skip to content

Commit

Permalink
Add url encoding to emails in url and remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenmaguire committed Sep 22, 2016
1 parent 79dda27 commit 13eec0c
Showing 1 changed file with 1 addition and 54 deletions.
55 changes: 1 addition & 54 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,9 @@
},

requests: {
fetchCustomer: function (customerId) {
return {
url: 'https://app.promoter.io/api/contacts/'+customerId,
type:'GET',
headers: {
Authorization: 'Token '+this.settings.api_key
},
dataType: 'json'
};
},
fetchCustomerFeedbackByEmail: function (email) {
return {
url: 'https://app.promoter.io/api/feedback/?survey__contact__email='+email,
type:'GET',
headers: {
Authorization: 'Token '+this.settings.api_key
},
dataType: 'json'
};
},
fetchCustomersByEmail: function (email) {
return {
url: 'https://app.promoter.io/api/contacts/?email='+email,
url: 'https://app.promoter.io/api/feedback/?survey__contact__email='+email.replace(/\+/g, '%2B'),
type:'GET',
headers: {
Authorization: 'Token '+this.settings.api_key
Expand Down Expand Up @@ -66,35 +46,6 @@
return promoterFeedback;
},

cache: function (key, data) {
this.store(key, data);
},

cachePromoterCustomerSearch: function (promoterCustomers) {
var customerIds = [];
if (promoterCustomers.results && promoterCustomers.results.length) {
for (var i = promoterCustomers.results.length - 1; i >= 0; i--) {
var customer = this.buildCustomerFromPromoterCustomer(promoterCustomers.results[i]);
customerIds.push(customer.id);
}
this.cache('customerIds', customerIds);
}
},

cacheClear: function (key) {

},

cacheFetch: function (key, default_value) {
default_value = default_value || null;
try {
var value = this.store(key);
return value ? value : default_value;
} catch (error) {
return default_value;
}
},

clone: function(obj) {
if (null == obj || "object" != typeof obj) {
return obj;
Expand All @@ -111,10 +62,6 @@
return moment(date_string).format(format);
},

formatMoney: function (number) {
return '$' + parseFloat(Math.round(number * 100) / 100).toFixed(2);
},

getCustomerEmail: function () {
if (this.currentLocation() === 'ticket_sidebar') {
return this.ticket().requester().email();
Expand Down

0 comments on commit 13eec0c

Please sign in to comment.