ducky/web

Paddy 2015-07-07 Parent:791aec3eb17b Child:bc1478742a50

17:313780205e39 Go to Latest

ducky/web/src/models/profile.js

Use our "production" config values. Use config values for our hosted test instance of the services. These aren't actually production values, but they're at least _live_ values.

History
paddy@0 1 import Model from 'ampersand-model'
paddy@12 2 import refresh from '../helpers/oauth-refresh'
paddy@0 3
paddy@0 4 export default Model.extend({
paddy@0 5 props: {
paddy@0 6 'id': 'string',
paddy@0 7 'name': 'string',
paddy@0 8 'created': 'date',
paddy@0 9 'last_seen': 'date',
paddy@0 10 },
paddy@12 11 sync: refresh.Sync,
paddy@12 12 parse (attrs) {
paddy@12 13 if (attrs.profiles && attrs.profiles.length == 1) {
paddy@12 14 attrs = attrs.profiles[0]
paddy@12 15 }
paddy@12 16 return attrs
paddy@12 17 },
paddy@12 18 ajaxConfig () {
paddy@12 19 return {
paddy@12 20 headers: {
paddy@12 21 'Authorization': 'Bearer '+app.me.access_token,
paddy@12 22 'Accept': 'application/json',
paddy@12 23 }
paddy@12 24 }
paddy@12 25 },
paddy@0 26 })