Skip to content

Commit

Permalink
Update device service environment variable hook to navigate via devic…
Browse files Browse the repository at this point in the history
…e rather than service install

Change-type: patch
  • Loading branch information
otaviojacobi committed Nov 27, 2024
1 parent eaf68d0 commit 11135a4
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions src/features/vars-schema/hooks/vars-update-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,43 +293,7 @@ addEnvHooks('service_environment_variable', async (args) => {
];
});

addEnvHooks('device_service_environment_variable', async (args) => {
if (args.req.body.service_install != null) {
return {
service_install: {
$any: {
$alias: 's',
$expr: { s: { id: args.req.body.service_install } },
},
},
};
}

const envVarIds = await sbvrUtils.getAffectedIds(args);
if (envVarIds.length === 0) {
return;
}
return [
envVarIds,
(envVarIdsChunk) => ({
service_install: {
$any: {
$alias: 's',
$expr: {
s: {
device_service_environment_variable: {
$any: {
$alias: 'e',
$expr: { e: { id: { $in: envVarIdsChunk } } },
},
},
},
},
},
},
}),
];
});
addDeviceEnvHooks('device_service_environment_variable');

addEnvHooks('image_environment_variable', async (args) => {
if (args.req.body.release_image != null) {
Expand Down

0 comments on commit 11135a4

Please sign in to comment.