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

[DAT-26] feat: Pass stored webhook to pipeline execution #1133

Merged
merged 2 commits into from
Jan 19, 2024
Merged

Conversation

paultranvan
Copy link
Contributor

When passing a webhook URL to the pipeline execution request, the server
will request it after its completion.
This webhook is typically the openpath trips fetching. Thanks to this,
we will now be able to retrieve the trips as soon as they are produced.

Related to cozy/coachCO2#370

When passing a webhook URL to the pipeline execution request, the server
will request it after its completion.
This webhook is typically the openpath trips fetching. Thanks to this,
we will now be able to retrieve the trips as soon as they are produced.
const webhookQuery = buildServiceWebhookQuery()
const webhookResp = useQuery(webhookQuery.definition, webhookQuery.options)

if (Array.isArray(webhookResp.data) && webhookResp.data.length > 0) {
Copy link
Contributor

@zatteo zatteo Jan 19, 2024

Choose a reason for hiding this comment

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

nit: You can webhookResp?.data?.length > 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually added the Array.isArray because typescript was complaining with: Property 'length' does not exist on type 'object | any[]'.

@zatteo
Copy link
Contributor

zatteo commented Jan 19, 2024

Very nice a huge step in user experience!

@paultranvan paultranvan merged commit 4cd5131 into master Jan 19, 2024
1 check passed
@paultranvan paultranvan deleted the webhook branch January 19, 2024 13:07
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