Replies: 1 comment 2 replies
-
We're missing a lot of context about your route, but it looks like the problem comes from the colon in Here's the code corrected : router.post('/:jobId/change-status', async (req, res, next) => {
console.log('CALLED!!');
const jobs = getDb().collection('jobs');
const result = await jobs.updateOne(
{ id: req.params.jobId },
{ $set: { status: 'completed', completedDate: DateTime.now().toISO() } },
{ upsert: false });
res.status(200).send(`Job ${req.params.jobId} marked as completed.`);
}); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to replicate this way of defining custom verbs:
https://cloud.google.com/apis/design/custom_methods
Example:
https://service.name/v1/some/resource/name:customVerb
I can't get the route to match. This is my code:
What's the proper syntax? The documentation is not clear.
Regards.
Beta Was this translation helpful? Give feedback.
All reactions