align business logic organizer side

This commit is contained in:
Jaanu423
2025-10-01 15:44:11 +05:30
parent f854bd6765
commit 9154a1482c
15 changed files with 335 additions and 44 deletions
+4 -5
View File
@@ -52,12 +52,12 @@ export default function GroupCreationForm() {
const newErrors: any = {};
if (!form.groupName.trim()) newErrors.groupName = "Group name is required.";
if (!form.description.trim()) newErrors.description = "Description is required.";
if (!form.minParticipants || Number(form.minParticipants) <= 1) newErrors.minParticipants = "Min participants must be at least 2.";
if (!form.minParticipants || Number(form.minParticipants) <= 0) newErrors.minParticipants = "Min participants must be at least 1.";
if (!form.maxParticipants || Number(form.maxParticipants) < Number(form.minParticipants)) newErrors.maxParticipants = "Max must be greater than or equal to min.";
if (!form.contributionAmount || Number(form.contributionAmount) <= 0) newErrors.contributionAmount = "Amount must be greater than 0.";
// if (form.cycleType === "CUSTOM" && (!form.customCycleDays || Number(form.customCycleDays) <= 0)) newErrors.customCycleDays = "Custom days must be greater than 0.";
if (form.lateFeeMode && (!form.lateFeeValue || Number(form.lateFeeValue) <= 0)) newErrors.lateFeeValue = "Late fee value is required.";
if (form.cycleType === "CUSTOM" && (!form.customCycleDays || Number(form.customCycleDays) <= 0)) newErrors.customCycleDays = "Custom days must be greater than 0.";
if (!form.lateFeeMode && (!form.lateFeeValue || Number(form.lateFeeValue) <= 0)) newErrors.lateFeeValue = "Late fee value is required.";
console.log("new errors : ", newErrors)
setErrors(newErrors);
return Object.keys(newErrors).length === 0;
};
@@ -82,7 +82,6 @@ export default function GroupCreationForm() {
return (
<KeyboardAvoidingView
style={{ flex: 1, backgroundColor: "#f5f6fa", paddingTop: Platform.OS === "android" ? 40 : 0 }}
behavior={Platform.OS === "ios" ? "padding" : "height"}