update Order History

This commit is contained in:
aditya.siregar
2024-07-26 22:32:24 +07:00
parent 5ef14f3043
commit 105bda67a3
8 changed files with 30 additions and 35 deletions
+3 -9
View File
@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"furtuna-be/internal/common/logger"
"furtuna-be/internal/common/mycontext"
order2 "furtuna-be/internal/constants/order"
"furtuna-be/internal/entity"
"furtuna-be/internal/repository"
@@ -297,15 +298,8 @@ func (s *OrderService) updateWalletBalance(ctx context.Context, tx *gorm.DB, par
return err
}
func (s *OrderService) GetAllHistoryOrders(ctx context.Context, tokenString string, req entity.HistoryOrderSearch) ([]*entity.HistoryOrder, int, error) {
claims, err := s.crypt.ParseAndValidateJWT(tokenString)
if err != nil {
logger.ContextLogger(ctx).Error("error when get data token", zap.Error(err))
return nil, 0, err
}
historyOrders, total, err := s.repo.GetAllHystoryOrders(ctx, *claims, req)
func (s *OrderService) GetAllHistoryOrders(ctx mycontext.Context, req entity.HistoryOrderSearch) ([]*entity.HistoryOrder, int, error) {
historyOrders, total, err := s.repo.GetAllHystoryOrders(ctx, req)
if err != nil {
logger.ContextLogger(ctx).Error("error when get all history orders", zap.Error(err))
return nil, 0, err