Skip to content

Conversation

@KqLLL
Copy link
Contributor

@KqLLL KqLLL commented Apr 8, 2025

When I use the cronitor-js SDK to get monitor data, the data method always throws an error saying "data is not a function." So I checked the code and found that the monitor has a property also called data, which overrides the method.

    const cronitorClient = getCronitorClient();
    const monitorInstance = new cronitorClient.Monitor(alert.id);
    console.log('monitorInstance.data:', monitorInstance.data);

    const response = await monitorInstance.data() as IMonitor;
image

@KqLLL KqLLL changed the title Rename method to in Monitor class and add tests for loading monitor… Rename method to in Monitor class and add tests Apr 8, 2025
@KqLLL
Copy link
Contributor Author

KqLLL commented Apr 8, 2025

@aflanagan Hello, can you take a look at this PR?

Copy link
Contributor

@aflanagan aflanagan left a comment

Choose a reason for hiding this comment

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

wow, good catch, thank you!

@aflanagan aflanagan merged commit 3ee722e into cronitorio:master Apr 8, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants