Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Invalid note submits to /notes not /notes new #47

Open
leevigraham opened this issue May 19, 2015 · 2 comments
Open

Invalid note submits to /notes not /notes new #47

leevigraham opened this issue May 19, 2015 · 2 comments

Comments

@leevigraham
Copy link

If a note is submitted without a message it's invalid the user is redirected from the original form /note/new back to /note.

I understand that the postNoteAction is being served and processing the request so this is expected behaviour.

Is the only way around this abstracting the core of the postNoteMethod into a new method _handlePostAction() and calling it from both newNoteAction and postNoteAction? Given the example uses annotations I can't see any other way of implementing this.

Thoughts @gimler @lsmith77

@lsmith77
Copy link
Collaborator

you mean and then POSTing to newNoteAction in the HTML form rather than postNoteAction? I guess that is possible. Browsers do not make it very easy to do proper REST :-/

@leevigraham
Copy link
Author

you mean and then POSTing to newNoteAction in the HTML form rather than postNoteAction?

Yep that's exactly what I meant. Using standard yaml / xml routing would allow this as I think multiple routes could point to the same action with different patterns and methods. Unfortunately it seems that there are only implementations for FosRestBundle @QueryParam and NelmioApiDoc.

I don't think this is a big issue but I was hoping someone would have a good DRY solution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants