update order
This commit is contained in:
@@ -160,35 +160,35 @@ func (h *Handler) GetOrderHistory(c *gin.Context) {
|
||||
startDateStr := c.Query("start_date")
|
||||
endDateStr := c.Query("end_date")
|
||||
|
||||
// Build search request
|
||||
searchReq := entity.SearchRequest{}
|
||||
|
||||
// Set status if provided
|
||||
if status != "" {
|
||||
searchReq.Status = status
|
||||
}
|
||||
|
||||
// Parse and set limit
|
||||
limit := 10
|
||||
limit := 20
|
||||
if limitStr != "" {
|
||||
parsedLimit, err := strconv.Atoi(limitStr)
|
||||
if err == nil && parsedLimit > 0 {
|
||||
limit = parsedLimit
|
||||
}
|
||||
}
|
||||
if limit > 20 {
|
||||
limit = 20
|
||||
|
||||
if limit > 100 {
|
||||
limit = 100
|
||||
}
|
||||
|
||||
searchReq.Limit = limit
|
||||
|
||||
// Parse and set offset
|
||||
offset := 0
|
||||
|
||||
if offsetStr != "" {
|
||||
parsedOffset, err := strconv.Atoi(offsetStr)
|
||||
if err == nil && parsedOffset >= 0 {
|
||||
offset = parsedOffset
|
||||
}
|
||||
}
|
||||
|
||||
searchReq.Offset = offset
|
||||
|
||||
if startDateStr != "" {
|
||||
@@ -228,6 +228,8 @@ func (h *Handler) GetOrderHistory(c *gin.Context) {
|
||||
responseData = append(responseData, response.OrderHistoryResponse{
|
||||
ID: order.ID,
|
||||
CustomerName: order.CustomerName,
|
||||
CustomerID: order.CustomerID,
|
||||
IsMember: order.IsMemberOrder(),
|
||||
Status: order.Status,
|
||||
Amount: order.Amount,
|
||||
Total: order.Total,
|
||||
|
||||
Reference in New Issue
Block a user