Update
This commit is contained in:
parent
105bda67a3
commit
dfed117d90
@ -2,7 +2,6 @@ package order
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"furtuna-be/internal/common/errors"
|
"furtuna-be/internal/common/errors"
|
||||||
"furtuna-be/internal/common/mycontext"
|
|
||||||
"furtuna-be/internal/entity"
|
"furtuna-be/internal/entity"
|
||||||
"furtuna-be/internal/handlers/request"
|
"furtuna-be/internal/handlers/request"
|
||||||
"furtuna-be/internal/handlers/response"
|
"furtuna-be/internal/handlers/response"
|
||||||
@ -177,7 +176,7 @@ func (h *Handler) GetAllHistoryOrders(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx := mycontext.NewContext(c.Request.Context())
|
ctx := request.GetMyContext(c)
|
||||||
orders, total, err := h.service.GetAllHistoryOrders(ctx, req.ToEntity(ctx))
|
orders, total, err := h.service.GetAllHistoryOrders(ctx, req.ToEntity(ctx))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
response.ErrorWrapper(c, err)
|
response.ErrorWrapper(c, err)
|
||||||
|
|||||||
@ -105,8 +105,10 @@ func (b *OrderRepository) GetAllHystoryOrders(ctx context.Context, req entity.Hi
|
|||||||
return nil, 0, err
|
return nil, 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
page := (req.Offset - 1) * req.Limit
|
||||||
|
|
||||||
if req.Offset > 0 {
|
if req.Offset > 0 {
|
||||||
query = query.Offset(req.Offset)
|
query = query.Offset(page)
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.Limit > 0 {
|
if req.Limit > 0 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user