diff --git a/src/features/device-state/routes/state-get-v2.ts b/src/features/device-state/routes/state-get-v2.ts index 4f15d8b04..733463fbd 100644 --- a/src/features/device-state/routes/state-get-v2.ts +++ b/src/features/device-state/routes/state-get-v2.ts @@ -87,18 +87,13 @@ function buildAppFromRelease( // extract the per-image information const image = ipr.image[0]; - const si = device.service_install.find( - ({ service }) => service.__id === image.is_a_build_of__service[0].id, - ); const svc = image.is_a_build_of__service[0]; const environment: Dictionary = {}; varListInsert(ipr.image_environment_variable, environment); varListInsert(application.application_environment_variable, environment); varListInsert(svc.service_environment_variable, environment); varListInsert(device.device_environment_variable, environment); - if (si != null) { - varListInsert(si.device_service_environment_variable, environment); - } + varListInsert(svc.device_service_environment_variable, environment); const labels: Dictionary = {}; for (const { label_name, value } of [ @@ -188,6 +183,9 @@ const stateQuery = _.once(() => is_a_build_of__service: { $select: ['id', 'service_name'], $expand: { + device_service_environment_variable: { + $select: ['name', 'value'], + }, service_environment_variable: { $select: ['name', 'value'], }, @@ -208,14 +206,6 @@ const stateQuery = _.once(() => }, }, }, - service_install: { - $select: ['id', 'service'], - $expand: { - device_service_environment_variable: { - $select: ['name', 'value'], - }, - }, - }, belongs_to__application: { $select: ['id', 'app_name'], $expand: {