From 503f24882a84f7df66dbe44a679211b82852ef9c Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Fri, 26 Jun 2015 14:13:10 -0800 Subject: [PATCH] Removing one-off user adapter --- app/pods/user/adapter.js | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 app/pods/user/adapter.js diff --git a/app/pods/user/adapter.js b/app/pods/user/adapter.js deleted file mode 100644 index 6d9c191..0000000 --- a/app/pods/user/adapter.js +++ /dev/null @@ -1,27 +0,0 @@ -import Ember from 'ember'; -import DS from 'ember-data'; - -export default DS.RESTAdapter.extend({ - namespace: 'api', - host: function() { - return this.get('globals.apiURL'); - }.property(), - coalesceFindRequests: true, - ajaxError: function(jqXHR) { - // http://stackoverflow.com/a/24027443 - var error = this._super(jqXHR); - if (jqXHR && jqXHR.status === 422) { - var response = Ember.$.parseJSON(jqXHR.responseText), - errors = {}; - if (response.errors !== undefined) { - var jsonErrors = response.errors; - Ember.EnumerableUtils.forEach(Ember.keys(jsonErrors), function(key) { - errors[Ember.String.camelize(key)] = jsonErrors[key]; - }); - } - return new DS.InvalidError(errors); - } else { - return error; - } - } -});