Skip to content

Commit

Permalink
ref: ShowOrderDetails handler
Browse files Browse the repository at this point in the history
  • Loading branch information
abbasfisal committed Nov 29, 2024
1 parent 6c727b5 commit 921b669
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions internal/modules/public/handlers/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,11 +669,17 @@ func (p PublicHandler) ShowOrderList(c *gin.Context) {
func (p PublicHandler) ShowOrderDetails(c *gin.Context) {
q := c.Param("order_number")
order, err := p.homeSrv.GetOrderBy(c, q)
log.Println("---- er:", err)
c.JSON(200, gin.H{
"orderNumber": q,
// "err": err.(error).Error(),
"order": order,
if err != nil {
log.Println("---- [public - handlers]-[ShowOrderDetails]----", err)
c.JSON(http.StatusOK, gin.H{
"msg": custom_error.SomethingWrongHappened,
})
return
}
html.CustomerRender(c, http.StatusFound, "customer_order_details", gin.H{
"TITLE": "جزییات سفارش",
"DATA": order,
"ACTIVE": "orders",
})
return
}

0 comments on commit 921b669

Please sign in to comment.