Error: New route X conflicts with existing Y #1
Comments
Yeah. Right. I loop through the But I see the need to have multiple methods for one route but I would prefer the following approach. Instead of: urls: [
{
params: '/{id}/note/{noteId}',
response: '/json-templates/foo.json',
method: 'PUT'
},
{
params: '/{id}/note/{noteId}',
response: '/json-templates/foo.json',
method: 'PATCH'
}
] I would define this route via urls: [
{
params: '/{id}/note/{noteId}',
response: '/json-templates/foo.json',
methods: ['PUT', 'PATCH']
}
] Feedback appreciated @krnlde @revrng Edit: Could it be a usecase to have:
In that case we would have to use something like: urls: [
{
params: '/{id}/note/{noteId}',
response: {
PUT: '/json-templates/foo.json',
PATCH: { success: true }
}
}
] or urls: [
{
params: '/{id}/note/{noteId}',
responses: [
{ method: 'PUT',
response: '/json-templates/foo.json' },
{ method: 'PATCH',
response: { success: true } }
]
}
] |
What if I need another response for PUT than for PATCH? |
See above ⬆️ |
D'accord |
The question is which of the two approaches is less ugly I guess I would prefer the latter one. |
The latter is the better for me. I think you can also omit the |
Cooool. I'm new, so sorry for being stupid :) |
Haha. My pleasure 😆 |
This should work since there are different methods to the same endpoint, but it fails with the following message:
Error: New route /api/salesItem/{id}/note/{noteId} conflicts with existing /api/salesItem/{id}/note/{noteId}
The text was updated successfully, but these errors were encountered: