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
Me and @kennyadsl have discussed this a little bit in Solidus PRs 4102 and 4081. So I thought it would be a good idea to consolidate the information and let discussion about it happen here for easier reference in the future.
The OrdersController currently has the following methods that make it unRESTful:
populate (can be moved to OrderContentsController like Solidus PR 4102 that would it fix Solidus frontend)
populate_redirect (discussed in Solidus PR 4081 that it doesn't give much value. Could be good maybe to remove it)
empty (can be moved to OrderContentsController)
accurate_title (can become a private method)
The method update also currently has two responsibilities:
update the @order.contents after submitting an edit cart form by clicking "update" or "checkout"
advance the order's state if the "checkout" button gets clicked and it's current state is cart (essentially start the checkout process)
This brings light to point worth discussing. If OrderContentsController was to be added and have the methods create and destroy which would respectively replace OrdersControllerspopulate and empty, the OrdersController wouldn't be truly RESTful and still would have multiple responsibilities. To achieve this the updating of @orders.content in update would have to be moved to OrdersContentsController. But currently on the cart page, both the "update" and "checkout" buttons act as save buttons for the edit cart form. Moving the update content functionality out would cause the "checkout" to longer be able to save the content changes.
Another point that would be nice to discuss is, if we make it RESTful, what would be the most desirable routes for both of these controllers? Keeping the cart route would be nice, but how should we handle the orders.content?
This issue has been automatically marked as stale because it has not had recent activity. It might be closed if no further activity occurs. Thank you for your contributions.
Me and @kennyadsl have discussed this a little bit in Solidus PRs 4102 and 4081. So I thought it would be a good idea to consolidate the information and let discussion about it happen here for easier reference in the future.
The
OrdersController
currently has the following methods that make it unRESTful:populate
(can be moved toOrderContentsController
like Solidus PR 4102 that would it fix Solidus frontend)populate_redirect
(discussed in Solidus PR 4081 that it doesn't give much value. Could be good maybe to remove it)empty
(can be moved toOrderContentsController
)accurate_title
(can become a private method)The method
update
also currently has two responsibilities:@order.contents
after submitting an edit cart form by clicking "update" or "checkout"order
's state if the "checkout" button gets clicked and it's currentstate
iscart
(essentially start the checkout process)This brings light to point worth discussing. If
OrderContentsController
was to be added and have the methodscreate
anddestroy
which would respectively replaceOrdersControllers
populate
andempty
, theOrdersController
wouldn't be truly RESTful and still would have multiple responsibilities. To achieve this the updating of@orders.content
inupdate
would have to be moved toOrdersContentsController
. But currently on the cart page, both the "update" and "checkout" buttons act as save buttons for the edit cart form. Moving the update content functionality out would cause the "checkout" to longer be able to save the content changes.Another point that would be nice to discuss is, if we make it RESTful, what would be the most desirable routes for both of these controllers? Keeping the
cart
route would be nice, but how should we handle theorders.content
?Here's the different routes paths we would need:
The text was updated successfully, but these errors were encountered: