forked from amer2004/SweetHome
OwnerStatistics api
This commit is contained in:
@ -69,30 +69,35 @@ export default function OwnerAccountBookPage() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
try {
|
try {
|
||||||
const data = await getOwnerStatistics();
|
const data = await getOwnerStatistics();
|
||||||
if (data) {
|
|
||||||
setStats({
|
if (data) {
|
||||||
totalRevenue: data.totalRevenue ?? null,
|
setStats({
|
||||||
totalReservations: data.totalReservations ?? null,
|
totalRevenue: data.totalRevenue ?? null,
|
||||||
activeProperties: data.activeProperties ?? null,
|
totalReservations: data.totalReservations ?? null,
|
||||||
financialRevenue: data.financialRevenue ?? null,
|
activeProperties: data.activeProperties ?? null,
|
||||||
financialCommission: data.financialCommission ?? null,
|
|
||||||
financialBalance: data.financialBalance ?? null,
|
|
||||||
directRevenue: data.directRevenue ?? null,
|
financialRevenue:
|
||||||
directCommission: data.directCommission ?? null,
|
data.financialRevenue ?? data.totalRevenue ?? null,
|
||||||
directBalance: data.directBalance ?? null,
|
|
||||||
directRating: data.directRating ?? null,
|
financialCommission: data.financialCommission ?? null,
|
||||||
directPostponements: data.directPostponements ?? null,
|
financialBalance: data.financialBalance ?? null,
|
||||||
});
|
directRevenue: data.directRevenue ?? null,
|
||||||
}
|
directCommission: data.directCommission ?? null,
|
||||||
} catch {
|
directBalance: data.directBalance ?? null,
|
||||||
toast.error('تعذر تحميل إحصائيات الحساب');
|
directRating: data.directRating ?? null,
|
||||||
} finally {
|
directPostponements: data.directPostponements ?? null,
|
||||||
setIsLoading(false);
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} catch {
|
||||||
|
toast.error('تعذر تحميل إحصائيات الحساب');
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
fetchData();
|
fetchData();
|
||||||
}, [router]);
|
}, [router]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user