|
|
@@ -20,7 +20,7 @@ const NotificationPageComponent = () => {
|
|
|
const [reservationAfter2025, setReservationAfter2025] = useState([]);
|
|
|
const [passingThisPromotionToBell, setPassingThisPromotionToBell] = useState([]);
|
|
|
const fetchData = async () => {
|
|
|
- try {
|
|
|
+ try {
|
|
|
const results = await Promise.allSettled([
|
|
|
chargeStationService.fetchReservationHistories(),
|
|
|
chargeStationService.getAdvertise()
|
|
|
@@ -44,16 +44,14 @@ const NotificationPageComponent = () => {
|
|
|
} else if (results[1].status === 'rejected') {
|
|
|
Alert.alert('Error fetching promotions:', results[1].reason);
|
|
|
}
|
|
|
-
|
|
|
} catch (error) {
|
|
|
- Alert.alert('Error fetching data');
|
|
|
+ console.log('Error fetching data');
|
|
|
} finally {
|
|
|
-
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
useEffect(() => {
|
|
|
- fetchData()
|
|
|
- }, [])
|
|
|
+ fetchData();
|
|
|
+ }, []);
|
|
|
return (
|
|
|
<SafeAreaView className="flex-1 bg-white" edges={['top', 'left', 'right']}>
|
|
|
<View style={{ minHeight: screenHeight, flex: 1 }} className="mx-[5%]">
|