author | Chloe Laisne <chloe.laisne@gmail.com> |
Sun, 02 Oct 2016 15:24:56 +0200 | |
changeset 311 | f4327199e8f0 |
parent 284 | 12448de16a63 |
child 319 | 78990a8a069b |
permissions | -rw-r--r-- |
284 | 1 |
import DS from 'ember-data'; |
2 |
||
3 |
export default DS.Serializer.extend({ |
|
4 |
||
5 |
normalizeResponse: function(store, primaryModelClass, payload) { |
|
6 |
var data = []; |
|
7 |
Object.keys(payload).forEach(function(key) { |
|
8 |
data.push({ |
|
9 |
'id': key, |
|
10 |
'type': 'geostat', |
|
11 |
'attributes': { |
|
12 |
'count': payload[key] |
|
13 |
} |
|
14 |
}); |
|
15 |
}); |
|
16 |
return { |
|
17 |
'data': data |
|
18 |
}; |
|
19 |
} |
|
20 |
||
21 |
}); |