-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[API] [Product Review] Configure product review as a API resource with tests #11173
Conversation
AdamKasp
commented
Mar 3, 2020
Q | A |
---|---|
Branch? | api |
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
License | MIT |
src/Sylius/Behat/Context/Api/Admin/ManagingProductReviewsContext.php
Outdated
Show resolved
Hide resolved
<attribute name="controller">sylius.api.state_machine_transition_applicator:accept</attribute> | ||
</itemOperation> | ||
<itemOperation name="reject_product_review"> | ||
<attribute name="method">PATCH</attribute> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how configure serialization group to have empty request body in state machine transition paths
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it look right now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not possible to update any of these fields according to https://github.com/Sylius/Sylius/pull/11173/files#diff-8705efddce0ceb9c7db5b7c1aa26bdc9R30-R35 (at least I think so).
Something, that should be reiterated later, but we can accept the current solution right now.
677f6f1
to
e5fb82d
Compare
src/Sylius/Bundle/ApiBundle/Applicator/StateMachineTransitionApplicator.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/ApiBundle/Applicator/StateMachineTransitionApplicator.php
Outdated
Show resolved
Hide resolved
src/Sylius/Behat/Context/Api/Admin/ManagingProductReviewsContext.php
Outdated
Show resolved
Hide resolved
e5fb82d
to
a887a12
Compare
src/Sylius/Behat/Context/Api/Admin/ManagingProductReviewsContext.php
Outdated
Show resolved
Hide resolved
src/Sylius/Behat/Context/Api/Admin/ManagingProductReviewsContext.php
Outdated
Show resolved
Hide resolved
src/Sylius/Behat/Context/Api/Admin/ManagingProductReviewsContext.php
Outdated
Show resolved
Hide resolved
src/Sylius/Behat/Context/Api/Admin/ManagingProductReviewsContext.php
Outdated
Show resolved
Hide resolved
39fdeb9
to
0c392c3
Compare
src/Sylius/Behat/Context/Api/Admin/ManagingProductReviewsContext.php
Outdated
Show resolved
Hide resolved
src/Sylius/Behat/Client/ApiPlatformStateMachineClientInterface.php
Outdated
Show resolved
Hide resolved
0c392c3
to
adb67af
Compare
f8713c9
to
a4d6239
Compare
src/Sylius/Behat/Context/Api/Admin/ManagingProductReviewsContext.php
Outdated
Show resolved
Hide resolved
src/Sylius/Behat/Context/Api/Admin/ManagingProductReviewsContext.php
Outdated
Show resolved
Hide resolved
src/Sylius/Behat/Context/Api/Admin/ManagingProductReviewsContext.php
Outdated
Show resolved
Hide resolved
src/Sylius/Behat/Context/Api/Admin/ManagingProductReviewsContext.php
Outdated
Show resolved
Hide resolved
src/Sylius/Behat/Resources/config/suites/api/product/managing_product_reviews.yml
Show resolved
Hide resolved
src/Sylius/Bundle/ApiBundle/Applicator/ProductReviewStateMachineTransitionApplicator.php
Show resolved
Hide resolved
<attribute name="controller">sylius.api.state_machine_transition_applicator:accept</attribute> | ||
</itemOperation> | ||
<itemOperation name="reject_product_review"> | ||
<attribute name="method">PATCH</attribute> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it look right now?
71f492d
to
d47acaf
Compare
e7f5219
to
bd7a575
Compare
src/Sylius/Bundle/ApiBundle/Applicator/ProductReviewStateMachineTransitionApplicator.php
Show resolved
Hide resolved
bd7a575
to
6fe8b87
Compare
/** | ||
* @When I want to modify the :productReview product review | ||
*/ | ||
public function iWantToModifyTheProductReview(ReviewInterface $productReview): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be
public function iWantToModifyTheProductReview(ReviewInterface $productReview): void | |
public function iWantToModifyTheProductReview(ProductReviewInterface $productReview): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure because we don't have this interface :D
ProductReview`` extends
Reviewwhich implements
ReviewInterface` :)
$this->stateMachineFactory = $stateMachineFactory; | ||
} | ||
|
||
public function accept(ReviewInterface $data): ReviewInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public function accept(ReviewInterface $data): ReviewInterface | |
public function accept(ReviewInterface $review): ReviewInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't work with argument named different that $data
in the documentation they mentioned about the argument in __invoke
but I assume in rest of controller function we have the same rule (https://api-platform.com/docs/core/controllers/)
Thanks, Adam! 🎉 |
all suggestions a fixed in #11197 |
Part of #11250 |