You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#2490 tries to solve this issue. But it ditches the use of OrderUpdateAttributes on Api::OrdersController. However, OrderUpdateAttributes is still used on Api::CheckoutsController on the update action.
The questions I raise are:
Should the current behavior of Api::OrderController really be considered wrong?
If Api::CheckoutsController relies on OrderUpdateAttributes, wouldn't it be susceptible to the same error as Api::OrdersController?
If Api::OrderController.update doesn't care about payment_attributes, should Api::OrderController.create care (for non admin users)?
If no, should OrderUpdateAttributes be removed from Api::OrderController, and the create action use order.contents.update_cart
If the above happens, should OrderUpdateAttributes get obsolete since only Api::CheckoutsController would rely on it, and instead it could rely on OrderUpdater.
If no, should OrderUpdateAttributes be altered to recalculate totals and apply cart promotions?
Sorry for so many questions, but there are many ways to fix the issue, and I could only help better with the guidance of the veterans.
The text was updated successfully, but these errors were encountered:
All your doubts are justified. I think that simply, when we added the OrderUpdateAttributes, we didn't considered all these things.
I think that the real difference is that in the Api::CheckoutController it works because there are other things that recalculate the order later (probably the next call). Also, checkout and orders api controllers are thought to make difference things, otherwise one of them could potentially be useless.
I think it's safe to use the same code that we used in the Api::OrderController.update and in the frontend orders controller update action.
I'll talk about this with the core team today, thanks for reporting your doubts.
To reproduce:
Result:
#2490 tries to solve this issue. But it ditches the use of
OrderUpdateAttributes
onApi::OrdersController
. However,OrderUpdateAttributes
is still used onApi::CheckoutsController
on theupdate
action.The questions I raise are:
Should the current behavior of
Api::OrderController
really be considered wrong?If
Api::CheckoutsController
relies onOrderUpdateAttributes
, wouldn't it be susceptible to the same error asApi::OrdersController
?If
Api::OrderController.update
doesn't care about payment_attributes, shouldApi::OrderController.create
care (for non admin users)?If no, should
OrderUpdateAttributes
be removed from Api::OrderController, and thecreate
action useorder.contents.update_cart
If the above happens, should
OrderUpdateAttributes
get obsolete since onlyApi::CheckoutsController
would rely on it, and instead it could rely onOrderUpdater
.If no, should
OrderUpdateAttributes
be altered to recalculate totals and apply cart promotions?Sorry for so many questions, but there are many ways to fix the issue, and I could only help better with the guidance of the veterans.
The text was updated successfully, but these errors were encountered: