correct issues

This commit is contained in:
Jaanu423
2025-10-13 15:07:31 +05:30
parent 848032768c
commit afe43b56a5
17 changed files with 350 additions and 336 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";
@@ -102,13 +103,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);
}
};