|
@@ -226,18 +226,13 @@ class RewardPointsController extends Controller
|
|
|
'created_at' => Carbon::parse($item->transaction_time)->format('Y-m-d H:i:s'),
|
|
'created_at' => Carbon::parse($item->transaction_time)->format('Y-m-d H:i:s'),
|
|
|
];
|
|
];
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
- return ApiResponse::success([
|
|
|
|
|
- 'current_points' => $this->rewardPointRepository->getCustomerPoints($customer->id),
|
|
|
|
|
- 'history' => $transformedHistory,
|
|
|
|
|
- 'pagination' => [
|
|
|
|
|
- 'current_page' => $history->currentPage(),
|
|
|
|
|
- 'per_page' => $history->perPage(),
|
|
|
|
|
- 'total' => $history->total(),
|
|
|
|
|
- 'last_page' => $history->lastPage(),
|
|
|
|
|
- 'has_more' => $history->hasMorePages()
|
|
|
|
|
- ]
|
|
|
|
|
- ]);
|
|
|
|
|
|
|
+ return ApiResponse::paginated(
|
|
|
|
|
+ [
|
|
|
|
|
+ 'current_points' => $this->rewardPointRepository->getCustomerPoints($customer->id),
|
|
|
|
|
+ 'history' => $transformedHistory
|
|
|
|
|
+ ],
|
|
|
|
|
+ $history
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|