author | Chloe Laisne <chloe.laisne@gmail.com> |
Sun, 25 Sep 2016 13:45:54 +0200 | |
changeset 289 | 7cae80e5748c |
parent 261 | 02e2396bcbbc |
child 305 | ff6cf3fc5f40 |
permissions | -rw-r--r-- |
126
e87a340711a4
improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
123
diff
changeset
|
1 |
import RESTAdapter from 'ember-data/adapters/rest'; |
e87a340711a4
improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
123
diff
changeset
|
2 |
import ENV from 'app-client/config/environment'; |
91
acfeddc7821d
rename "sound" to "document"
nowmad@nowmads-macbook-pro.local
parents:
90
diff
changeset
|
3 |
|
126
e87a340711a4
improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
123
diff
changeset
|
4 |
export default RESTAdapter.extend({ |
245
c9dd78a43b07
Transcript model and erializer
Chloe Laisne <chloe.laisne@gmail.com>
parents:
126
diff
changeset
|
5 |
|
261
02e2396bcbbc
Migrate to ember 2.7 + correct jquery null context error + declare shim for popcorn (instead of silencing the JSHint error)
ymh <ymh.work@gmail.com>
parents:
245
diff
changeset
|
6 |
namespace: ENV.rootURL.replace(/\/$/,"")+'/api/v1', |
126
e87a340711a4
improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
123
diff
changeset
|
7 |
|
245
c9dd78a43b07
Transcript model and erializer
Chloe Laisne <chloe.laisne@gmail.com>
parents:
126
diff
changeset
|
8 |
buildURL: function(modelName, id) { |
c9dd78a43b07
Transcript model and erializer
Chloe Laisne <chloe.laisne@gmail.com>
parents:
126
diff
changeset
|
9 |
if(modelName === 'transcript') { |
c9dd78a43b07
Transcript model and erializer
Chloe Laisne <chloe.laisne@gmail.com>
parents:
126
diff
changeset
|
10 |
return this.urlPrefix() + '/documents/' + id + '/' + modelName; |
c9dd78a43b07
Transcript model and erializer
Chloe Laisne <chloe.laisne@gmail.com>
parents:
126
diff
changeset
|
11 |
} |
c9dd78a43b07
Transcript model and erializer
Chloe Laisne <chloe.laisne@gmail.com>
parents:
126
diff
changeset
|
12 |
return this._super(...arguments); |
c9dd78a43b07
Transcript model and erializer
Chloe Laisne <chloe.laisne@gmail.com>
parents:
126
diff
changeset
|
13 |
}, |
42
7d091abf82fd
add application adapter to simulate REST, using fixtures
nowmad@nowmads-macbook-pro.local
parents:
diff
changeset
|
14 |
|
245
c9dd78a43b07
Transcript model and erializer
Chloe Laisne <chloe.laisne@gmail.com>
parents:
126
diff
changeset
|
15 |
pathForType: function(modelName) { |
c9dd78a43b07
Transcript model and erializer
Chloe Laisne <chloe.laisne@gmail.com>
parents:
126
diff
changeset
|
16 |
if(modelName === 'transcript') { |
c9dd78a43b07
Transcript model and erializer
Chloe Laisne <chloe.laisne@gmail.com>
parents:
126
diff
changeset
|
17 |
return modelName; |
c9dd78a43b07
Transcript model and erializer
Chloe Laisne <chloe.laisne@gmail.com>
parents:
126
diff
changeset
|
18 |
} |
c9dd78a43b07
Transcript model and erializer
Chloe Laisne <chloe.laisne@gmail.com>
parents:
126
diff
changeset
|
19 |
return this._super(...arguments); |
c9dd78a43b07
Transcript model and erializer
Chloe Laisne <chloe.laisne@gmail.com>
parents:
126
diff
changeset
|
20 |
} |
c9dd78a43b07
Transcript model and erializer
Chloe Laisne <chloe.laisne@gmail.com>
parents:
126
diff
changeset
|
21 |
|
261
02e2396bcbbc
Migrate to ember 2.7 + correct jquery null context error + declare shim for popcorn (instead of silencing the JSHint error)
ymh <ymh.work@gmail.com>
parents:
245
diff
changeset
|
22 |
}); |