summaryrefslogtreecommitdiffstats
path: root/web/react/utils/client.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/utils/client.jsx')
-rw-r--r--web/react/utils/client.jsx40
1 files changed, 37 insertions, 3 deletions
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx
index 786e6dcea..b4030baac 100644
--- a/web/react/utils/client.jsx
+++ b/web/react/utils/client.jsx
@@ -286,9 +286,12 @@ module.exports.getMeSynchronous = function(success, error) {
if (success) success(data, textStatus, xhr);
},
error: function(xhr, status, err) {
- if (error) {
- e = handleError("getMeSynchronous", xhr, status, err);
- error(e);
+ var ieChecker = window.navigator.userAgent; // This and the condition below is used to check specifically for browsers IE10 & 11 to suppress a 200 'OK' error from appearing on login
+ if (xhr.status != 200 || !(ieChecker.indexOf("Trident/7.0") > 0 || ieChecker.indexOf("Trident/6.0") > 0)) {
+ if (error) {
+ e = handleError("getMeSynchronous", xhr, status, err);
+ error(e);
+ };
};
}
});
@@ -811,3 +814,34 @@ module.exports.getStatuses = function(success, error) {
}
});
};
+
+module.exports.getMyTeam = function(success, error) {
+ $.ajax({
+ url: "/api/v1/teams/me",
+ dataType: 'json',
+ type: 'GET',
+ success: success,
+ ifModified: true,
+ error: function(xhr, status, err) {
+ e = handleError("getMyTeam", xhr, status, err);
+ error(e);
+ }
+ });
+};
+
+module.exports.updateValetFeature = function(data, success, error) {
+ $.ajax({
+ url: "/api/v1/teams/update_valet_feature",
+ dataType: 'json',
+ contentType: 'application/json',
+ type: 'POST',
+ data: JSON.stringify(data),
+ success: success,
+ error: function(xhr, status, err) {
+ e = handleError("updateValetFeature", xhr, status, err);
+ error(e);
+ }
+ });
+
+ module.exports.track('api', 'api_teams_update_valet_feature');
+};