Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for 202 for Post and Put actions #283

Merged

Conversation

afsalthaj
Copy link

@afsalthaj afsalthaj commented Jun 26, 2017

Could this be taken up while #280 is in progress?
#It is adding support for asynchronus operations for put! and post!...
It adds post-enacted? decision point (default value as true) and put-enacted? decision point (default value as true) after post! and put! actions respectively.
This implies if post!/put! is not complete, it redirects to handle-accepted (202 Accepted).

A new? generally would imply the post! or put! is completed, to further push things to handle-created or respond-with-entity. This is why an incompleted operation in progress is not passed to the nodes such as post-redirect? or new?.

I am yet to add the test cases. Please review the position of the decision points and give some insights.

@afsalthaj afsalthaj changed the title adding post-enacted and put-enacted decision points Support for 202 for Post and Put actions Jun 26, 2017
@ordnungswidrig
Copy link
Member

This additions make sense to me. What's missing is updating the graph, tests and documentation :-) Please let me know what you plan to contribute, creating the graph is a little non-obvious and I can do that.

@afsalthaj
Copy link
Author

afsalthaj commented Jun 26, 2017

@ordnungswidrig thanks for that. I can update the tests and documentation in next couple of days...

@afsalthaj
Copy link
Author

@ordnungswidrig Added test cases. Also, I have changed a few put test cases to use request-method-in, to avoid writing tests with a different method from allowed-methods and get it passed.

(facts "PUT requests"
(let [r (resource :method-allowed? [:put]
(let [r (resource :method-allowed? (request-method-in :put)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the best way would be to use :allowed-methods [:put].

Copy link
Author

@afsalthaj afsalthaj Jun 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am deleting the previous comment.. Sorry.. I get it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now you confused me because read the email notification including your comment first :-)

@ordnungswidrig
Copy link
Member

Besides my comment the patch looks fine!

@ordnungswidrig
Copy link
Member

As a final step, can you squash the commits down to a single one? That will make the timeline easier to navigate in the future.

@afsalthaj afsalthaj force-pushed the post_put_async_support branch from 75aec9a to 0f5fa33 Compare June 28, 2017 23:15
@afsalthaj
Copy link
Author

@ordnungswidrig Shall I change the version to 0.15? Currently it is 0.14.2..

@ordnungswidrig
Copy link
Member

I'll do the version upgrade dance when I'm doing the release.

@ordnungswidrig ordnungswidrig merged commit 487458d into clojure-liberator:master Jun 29, 2017
@ordnungswidrig
Copy link
Member

Thanks for the contribution!

@afsalthaj
Copy link
Author

@ordnungswidrig 👍

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

Successfully merging this pull request may close these issues.

2 participants