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
+6 -5
View File
@@ -9,6 +9,7 @@ import {
KeyboardAvoidingView,
Platform,
TouchableOpacity,
ToastAndroid,
} from "react-native";
import * as Keychain from "react-native-keychain";
import { CustomInput, CustomButton } from "../../components/common/Custom";
@@ -27,7 +28,7 @@ const BecomeOrg = () => {
const handleSubmit = async () => {
if (!idName || !idNumber || !issueDate) {
Alert.alert("Error", "Please fill all fields");
ToastAndroid.show("Please fill all fields", ToastAndroid.SHORT);
return;
}
@@ -35,7 +36,7 @@ const BecomeOrg = () => {
setLoading(true);
const credentials = await Keychain.getGenericPassword();
if (!credentials) {
Alert.alert("Error", "You are not logged in. Please log in to continue.");
ToastAndroid.show("You are not logged in. Please log in to continue.", ToastAndroid.SHORT);
setLoading(false);
// Optionally navigate to login screen
// navigation.navigate("Login");
@@ -62,17 +63,17 @@ const BecomeOrg = () => {
const result = await response.json();
if (response.ok && result.status === "success") {
Alert.alert("Success", "Organizer registration application submitted successfully!");
ToastAndroid.show("Organizer registration application submitted successfully!", ToastAndroid.SHORT);
setIdName("");
setIdNumber("");
setIssueDate("");
navigation.navigate("Home" as never);
} else {
Alert.alert("Error", result.message || "Failed to submit application");
ToastAndroid.show(result.message || "Failed to submit application", ToastAndroid.SHORT);
}
} catch (error) {
console.error("❌ Registration error:", error);
// Alert.alert("Error", "An unexpected error occurred. Please try again.");
ToastAndroid.show("An unexpected error occurred. Please try again.", ToastAndroid.SHORT);
} finally {
setLoading(false);
}