Closed ghicks-rmn closed 9 years ago
@ghicks-rmn this makes sense to me - pass data back that's received from the api rather than returning true. @ali-graham your thoughts?
Diner's behaviour predates the JSONAPI, so there wasn't any consistent content to present at the time it was developed, and it hasn't been changed since. GET
s currently return content as appropriate, and PATCH
es and DELETE
s don't have any content to return, so it would just be a matter of changing the code around POST
s to return the generated ids. I'll do this soon.
Actually, on further review, I'd already made this change in master since the last release. Bonus!
:tada:
This is awesome. What release is this planned to come out with, and when might that release hit ? We're trying to implement some tooling with flapjack-diner, and having this functionality would greatly simplify our tooling logic.
Right now, Diner returns 'true' if a request was sent successfully, and 'false' if it failed. Shouldn't it return any data that was sent to it from Flapjack instead?
For example, when I create a new Contact, I would expect to get its unique ID back in response so I can begin tying that contact to rules or entities. The JSON API does actually return this data, and Diner writes it to the API log - but there's no easy way to retrieve it in your code without performing a separate GET action, filtering it, and hoping that there are no duplicated names in your Flapjack setup.
Is there a reason that the simple 'true' and 'false' behavior was chosen over this? Should it be changed?