From 81a658cc71f164fb9b8af83713f056152de410c6 Mon Sep 17 00:00:00 2001 From: De Cramer Oliver Date: Wed, 16 Oct 2024 20:03:33 +0200 Subject: [PATCH] doc: Adding a tip about api's preventing methods beside GET to load non cart orders by default --- docs/customization/api/adding_and_removing_endpoints.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/customization/api/adding_and_removing_endpoints.rst b/docs/customization/api/adding_and_removing_endpoints.rst index 36c0fd239d..baa9890d4a 100644 --- a/docs/customization/api/adding_and_removing_endpoints.rst +++ b/docs/customization/api/adding_and_removing_endpoints.rst @@ -23,6 +23,13 @@ And that's all, now you have a new endpoint with your custom logic. Read more about API Platform endpoint configuration `here `_ +Good to Know +~~~~~~~~~~~~ + +.. tip:: + Api Platform is configured to prevent modifications to orders not in the ``cart`` state. There is only a few specific actions allowed. This is done by preventing orders not in the state ``cart`` from loading if the api's method is not ``GET``. So if you need to add an endpoint to an api that needs to edit orders that are not in the state ``cart`` you will need to whitelist your api. This can be done by adding your api's route to the ``sylius.api.doctrine_extension.order_shop_user_item.filter_cart.allowed_non_get_operations`` parameter. + + How to remove an endpoint? --------------------------