ducky/web

Paddy 2015-07-07 Parent:9b97c908a706 Child:13d27b50d79e

19:6b7037b4cbe7 Browse Files

Update to hosted URL, use oauth-refresh in profiles. When syncing the profiles, use our oauth-refresh sync helper, so it won't fail because of an expired OAuth token. Also, update our URL to use the nginx-fronted URL.

src/models/profiles.js

     1.1 --- a/src/models/profiles.js	Tue Jul 07 21:19:11 2015 -0400
     1.2 +++ b/src/models/profiles.js	Tue Jul 07 21:21:28 2015 -0400
     1.3 @@ -1,5 +1,4 @@
     1.4  import Collection from 'ampersand-rest-collection'
     1.5 -import Sync from 'ampersand-sync'
     1.6  import Profile from './profile'
     1.7  import config from '../config'
     1.8  import isObject from 'lodash.isobject'
     1.9 @@ -8,7 +7,7 @@
    1.10  
    1.11  export default Collection.extend({
    1.12    model: Profile,
    1.13 -  url: config.urlBase + '/profiles',
    1.14 +  url: config.urlBase + '/auth/profiles',
    1.15    ajaxConfig () {
    1.16      return {
    1.17        headers: {
    1.18 @@ -42,7 +41,7 @@
    1.19      options.error = function(resp) {
    1.20        moc.trigger('error', moc, resp, options)
    1.21      }
    1.22 -    let sync = Sync('create', moc, options)
    1.23 +    let sync = refresh.Sync('create', moc, options)
    1.24      return sync
    1.25    },
    1.26  })