correct issues
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user