dashboard marged

This commit is contained in:
Abin Toppo
2025-10-16 15:37:57 +05:30
19 changed files with 673 additions and 589 deletions
+4 -2
View File
@@ -8,6 +8,7 @@ import {
TouchableOpacity,
ActivityIndicator,
Alert,
ToastAndroid,
} from "react-native";
import { useNavigation, useFocusEffect, useRoute, RouteProp } from "@react-navigation/native";
import { StackNavigationProp } from "@react-navigation/stack";
@@ -103,13 +104,14 @@ const ManagementScreen: FC = () => {
// No need to set loading here if the whole screen is already loading
const res = await apiCall(url, "PUT", {}) as ApiResponse<null> | null;
if (res && res.statusCode === 200) {
Alert.alert("Success", res.message || successMessage);
ToastAndroid.show("Success", ToastAndroid.SHORT);
fetchData(); // Refresh data after action
} else {
throw new Error(res?.message || failureMessage);
}
} catch (err: any) {
// Alert.alert("Error", err.message || "An unexpected error occurred.");
console.error("Action Error:", err);
ToastAndroid.show(err.message || failureMessage, ToastAndroid.SHORT);
}
};