Closed Ramin-RX7 closed 1 year ago
In the staff panel, there are several links/buttons that has to perform an action on the orders.
We need different urls and views to handle these actions:
/dashboard/order/edit/ORDER_ID:
/dashboard/order/edit/ORDER_ID
edit_order
/dashboard/order/approve/ORDER_ID:
/dashboard/order/approve/ORDER_ID
approve
/dashboard/order/reject/ORDER_ID:
/dashboard/order/reject/ORDER_ID
reject
/dashboard/order/pay/ORDER_ID:
/dashboard/order/pay/ORDER_ID
pay
Note: simple actions mentioned in the list above has to use this as their decorator:
simple actions
a function that will call the requested view and then return the user back to the dashboard url.
This is done to reduce the same code and also make the code easier to change (if the name of the url changes in the future)
In the staff panel, there are several links/buttons that has to perform an action on the orders.
We need different urls and views to handle these actions:
/dashboard/order/edit/ORDER_ID
:edit_order
which is empty as of now/dashboard/order/approve/ORDER_ID
:approve
method of the order/dashboard/order/reject/ORDER_ID
:approve
but forreject
buttons/dashboard/order/pay/ORDER_ID
:approve
andreject
but forpay
buttonNote:
simple actions
mentioned in the list above has to use this as their decorator:a function that will call the requested view and then return the user back to the dashboard url.
This is done to reduce the same code and also make the code easier to change (if the name of the url changes in the future)