Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Device params in payload parser #8

Merged
merged 1 commit into from
Aug 11, 2022

Conversation

matheuslbenachio
Copy link
Contributor

This PR fixes the params key in the device passed to the device simulator, and thus fixing the issue #6.

Only sent = false parameters will be passed to the device object.

@@ -34,14 +35,17 @@ export const runPayloadParser = async (
throw new Error(`Payload parser file is empty or doesn't exist`);
}

const params = await getDeviceParamList(device.id, false);
const paramsMapped = params.map((x) => ({ key: x.key, value: x.value, sent: x.sent })); // map to remove id

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can also do:

Suggested change
const paramsMapped = params.map((x) => ({ key: x.key, value: x.value, sent: x.sent })); // map to remove id
const paramsMapped = params.map((x) => ({ ...x, id: undefined })); // map to remove id

@matheuslbenachio matheuslbenachio changed the title Fix: device params in payload parser Fix: Device params in payload parser Jul 30, 2022
@matheuslbenachio matheuslbenachio merged commit 3591a32 into main Aug 11, 2022
@matheuslbenachio matheuslbenachio deleted the fix/payload-parser-device-params branch August 11, 2022 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants