-
Notifications
You must be signed in to change notification settings - Fork 19
Webhook endpoint #83
base: develop
Are you sure you want to change the base?
Webhook endpoint #83
Conversation
Since the endpoint returns "OK" no matter what, I tried refactoring it a little. This is what I came up with: NB: Only a suggestion, not finished and it's not fully tested. |
Thats amazing! liked alot the custom responses. I gonna test and clean up here and there but great job. 🙌 |
I forced the commit with --no-verify flag bc i don't know how to proper test this endpoint.
Also I added the @ewenjo suggestions with some minor adjustments to the credit goes to him. |
@nicomigueles I will do a full review tomorrow but one immediate issue that I see with using that fetchVideosJob function for the fetch-videos route and the cron job is the return structure vs log structure. If you return when the YouTube API responds with no videos wont that exit the job? Even if not we would still want logs...? Regarding the testing, You can use the other admin test as an example and see if that gets your coverage up. Let me know if you need help. |
It would log the first "error"/"message" that encounters. I don't think that the
|
I assume that the CI is falling because of old or invalid YOUTUBE-API-KEY. |
I don't think that I can fix that. I can't generate a new YouTube API key and put it into Travis. If I am not mistaken only @w3cj can do that. |
@sbibow yeah, if you put a new key into Travis it would work. We have to wait the @w3cj powers then. |
POST /admin/fetch-videos
Meant to be used as endpoint to fetch the videos from YouTube.