manage user credancial

This commit is contained in:
Jaanu423
2025-09-23 13:25:09 +05:30
parent bcd41f81e6
commit 64282654f0
11 changed files with 299 additions and 105 deletions
+8 -8
View File
@@ -150,17 +150,17 @@ export default function GroupScreen() {
const handleJoinGroup = async (groupId: string, userId: string) => {
console.log("Joining group:", groupId, "User:", userId);
try {
const url = `${JOIN_GROUP_URL}/groups/${groupId}/join/0`;
const url = `${JOIN_GROUP_URL}groups/${groupId}/join/10`;
console.log("Joining group URL:", url);
const res = await apiCall(url, "POST") as { statusCode?: number; message?: string };
const res = await apiCall(url, "POST");
console.log("JOIN_GROUP_URL response:", res);
if (res.statusCode === 200) {
Alert.alert("Success", "You requested to join the group.");
} else {
Alert.alert("Error", res.message || "Failed to join group.");
}
// if (res.statusCode === 200) {
// Alert.alert("Success", "You requested to join the group.");
// } else {
// Alert.alert("Error", res.message || "Failed to join group.");
// }
} catch (error) {
console.error("Join Group Error:", error);
Alert.alert("Error", "An unexpected error occurred.");
@@ -264,7 +264,7 @@ export default function GroupScreen() {
refreshControl={
<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />
}
ListFooterComponent={<ActivityIndicator size={'large'} color={colors.Group} />}
// ListFooterComponent={<ActivityIndicator size={'large'} color={colors.Group} />}
/>
);
};