Updated by info missing
When requesting a device, sometimes (yes I know it sounds weird), the updated_by
property is missing, although the device was updated.
I'm requesting a device like so:
GET http://rz-vm64.gfz-potsdam.de:3001/backend/api/v1/devices/3?include=created_by.contact,updated_by.contact
This is the response that I got:
{
"data":{
"type":"device",
"attributes":{
"status_name":"",
"manufacturer_name":"",
"is_public":false,
"status_uri":"",
"created_by_id":"2", // <-- this is fine, but where is "updated_by_id"?
"manufacturer_uri":"",
"description":"dfdfdf",
"inventory_number":"",
"device_type_uri":"http://rz-vm64.gfz-potsdam.de/cv/api/v1/equipmenttypes/49/",
"persistent_identifier":null,
"long_name":"",
"model":"",
"short_name":"Test Device",
"is_internal":true,
"is_private":false,
"website":"",
"dual_use":false,
"group_ids":[
"1316",
"1315"
],
"created_at":"2022-03-28T13:13:58.963984",
"updated_at":"2022-03-31T09:09:43.703704",
"device_type_name":"Altimeter",
"serial_number":""
},
"relationships":{
"updated_by":{
"links":{
"self":"/backend/api/v1/devices/3/relationships/updated-user"
},
"data":null // <-- huh, why it is null?
},
"device_attachments":{
"links":{
"related":"/backend/api/v1/devices/3/relationships/device-attachments"
},
"data":[
]
},
"device_mount_actions":{
"links":{
"related":"/backend/api/v1/devices/3/relationships/device-mount-actions"
},
"data":[
]
},
"device_properties":{
"links":{
"related":"/backend/api/v1/devices/3/relationships/device-properties"
},
"data":[
]
},
"device_unmount_actions":{
"links":{
"related":"/backend/api/v1/devices/3/relationships/device-unmount-actions"
},
"data":[
]
},
"customfields":{
"links":{
"related":"/backend/api/v1/devices/3/relationships/customfields"
},
"data":[
]
},
"device_software_update_actions":{
"links":{
"related":"/backend/api/v1/devices/3/relationships/device-software-update-actions"
},
"data":[
]
},
"events":{
"links":{
"related":"/backend/api/v1/devices/3/relationships/events"
},
"data":[
]
},
"contacts":{
"links":{
"related":"/backend/api/v1/devices/3/relationships/contacts"
},
"data":[
{
"type":"contact",
"id":"2"
}
]
},
"device_calibration_actions":{
"links":{
"related":"/backend/api/v1/devices/3/relationships/device-calibration-actions"
},
"data":[
]
},
"configuration_device":{
"links":{
"self":"/backend/api/v1/devices/3/relationships/configuration-device"
},
"data":{
"type":"configuration_device",
"id":"[]"
}
},
"generic_device_actions":{
"links":{
"related":"/backend/api/v1/devices/3/relationships/generic-device-actions"
},
"data":[
]
},
"created_by":{
"links":{
"self":"/backend/api/v1/devices/3/relationships/created-user",
"related":"/backend/api/v1/users/2"
},
"data":{ // <-- yes I want this!
"type":"user",
"id":"2"
}
}
},
"id":"3",
"links":{
"self":"/backend/api/v1/devices/3"
}
},
"links":{
"self":"/backend/api/v1/devices/3"
},
"included":[
{
"type":"user",
"attributes":{
"subject":"mhanisch@gfz-potsdam.de"
},
"relationships":{
"contact":{
"links":{
"self":"/backend/api/v1/users/2/relationships/contact",
"related":"/backend/api/v1/contacts/2"
},
"data":{
"type":"contact",
"id":"2"
}
}
},
"id":"2",
"links":{
"self":"/backend/api/v1/users/2"
}
},
{
"type":"contact",
"attributes":{
"email":"marc.hanisch@gfz-potsdam.de",
"active":true,
"given_name":"Marc",
"family_name":"Hanisch",
"website":"dfdf"
},
"relationships":{
"user":{
"links":{
"self":"/backend/api/v1/contacts/2/relationships/user"
},
"data":{
"type":"user",
"id":"2"
}
},
//...
"devices":{
"links":{
"related":"/backend/api/v1/contacts/2/relationships/devices"
},
"data":[
{
"type":"device",
"id":"3"
}
]
}
},
"id":"2",
"links":{
"self":"/backend/api/v1/contacts/2"
}
}
],
"jsonapi":{
"version":"1.0"
}
}
My assumption is, that the updated_by
property is not set when the user is the same as the one who created the device?
Edited by Marc Hanisch