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