author | ymh <ymh.work@gmail.com> |
Tue, 20 Mar 2018 15:02:40 +0100 | |
changeset 573 | 25f3d28f51b2 |
parent 355 | 83f5247f3c7a |
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 = []; |
|
319
78990a8a069b
Work on front and back integration, correct the expected data format
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
7 |
Object.keys(payload['geostats']).forEach(function(key) { |
284 | 8 |
data.push({ |
9 |
'id': key, |
|
10 |
'type': 'geostat', |
|
11 |
'attributes': { |
|
355
83f5247f3c7a
Fix carto counts and map colors
Chloe Laisne <chloe.laisne@gmail.com>
parents:
319
diff
changeset
|
12 |
'count': payload['geostats'][key] |
284 | 13 |
} |
14 |
}); |
|
15 |
}); |
|
16 |
return { |
|
17 |
'data': data |
|
18 |
}; |
|
19 |
} |
|
20 |
||
319
78990a8a069b
Work on front and back integration, correct the expected data format
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
21 |
}); |