Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
Corected parameter - adding logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonzalo Avalos Ribas authored and Gonzalo Avalos Ribas committed Nov 16, 2023
1 parent d53eb1d commit 7745350
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/steps/profiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,30 @@ export async function buildDeviceProfileRelationships({
const details = await apiClient.fetchProfilesDetails(
profile.Id.Value?.toString(),
);
logger.info(
{ detailKeys: Object.keys(details.general) },
'TEMP - detail keys.',
);
profileUUid = details.general.uuid;
}
if (
response.DeviceId.Uuid &&
profile.Uuid &&
profileUUid &&
jobState.hasKey(response.DeviceId.Uuid) &&
jobState.hasKey(profile.Uuid)
jobState.hasKey(profileUUid)
) {
await jobState.addRelationship(
createDirectRelationship({
_class: DEVICE_PROFILE_REATIONSHIP_CLASS,
fromKey: response.DeviceId.Uuid,
fromType: DEVICE_ENTITY_TYPE,
toKey: profile.Uuid,
toKey: profileUUid,
toType: PROFILE_ENTITY_TYPE,
}),
);
} else {
logger.info(
{ fromKey: response.DeviceId.Uuid, toKey: profile.Uuid },
{ fromKey: response.DeviceId.Uuid, toKey: profileUUid },
'Could not create a relationship',
);
}
Expand Down

0 comments on commit 7745350

Please sign in to comment.