fix: read dashboard stats response
This commit is contained in:
+2
-2
@@ -216,8 +216,8 @@ export const productTracesApi = {
|
|||||||
export const dashboardApi = {
|
export const dashboardApi = {
|
||||||
getStats: async () => {
|
getStats: async () => {
|
||||||
const response = await apiClient.get('/dashboard/stats');
|
const response = await apiClient.get('/dashboard/stats');
|
||||||
if (response.data.data) {
|
const data = response.data.data || response.data;
|
||||||
const data = response.data.data;
|
if (data?.overview) {
|
||||||
return {
|
return {
|
||||||
totalAftersales: data.overview?.totalAftersales || 0,
|
totalAftersales: data.overview?.totalAftersales || 0,
|
||||||
pendingConfirmation: data.overview?.pendingConfirmation || 0,
|
pendingConfirmation: data.overview?.pendingConfirmation || 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user