1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

Fix property timestamp fetch

This commit is contained in:
Markus Grigull 2015-10-07 16:09:07 +02:00
parent 35e63c34fc
commit 7fdd3e9259
2 changed files with 9 additions and 1 deletions

View file

@ -48,6 +48,7 @@ export default DS.RESTSerializer.extend({
if (item.contextElement.attributes) {
item.contextElement.attributes.forEach(function(attribute) {
// create property
var property = {
type: 'property',
id: 'property_' + propertyIndex++,
@ -55,7 +56,6 @@ export default DS.RESTSerializer.extend({
name: attribute.name,
type: attribute.type,
value: attribute.value,
timestamp: attribute.metadatas[0].value
},
relationships: {
entity: {
@ -64,6 +64,13 @@ export default DS.RESTSerializer.extend({
}
}
// find timestamp
attribute.metadatas.forEach(function(metadata) {
if (metadata.name === 'timestamp') {
property.attributes.timestamp = metadata.value;
}
});
entity.relationships.properties.data.push({ type: 'property', id: property.id });
handleEntity(property);

View file

@ -42,6 +42,7 @@ module.exports = function(environment) {
ENV['ember-cli-mirage'] = {
enabled: true
//enabled: false
}
}