From a7aeb3d3f9690da6f47f3e818068f31f537bae97 Mon Sep 17 00:00:00 2001 From: amaliadwiy Date: Thu, 28 Aug 2025 12:00:46 +0800 Subject: [PATCH] upd : validasi no telp Deskripsi: - validasi nomor telepon >= 9 dan <=16 - tambah anggota, edit anggota, edit profile No Issues --- app/(application)/edit-profile.tsx | 2 +- app/(application)/member/create.tsx | 2 +- app/(application)/member/edit/[id].tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/(application)/edit-profile.tsx b/app/(application)/edit-profile.tsx index e0ef9ba..c0fd456 100644 --- a/app/(application)/edit-profile.tsx +++ b/app/(application)/edit-profile.tsx @@ -122,7 +122,7 @@ export default function EditProfile() { } } else if (cat == "phone") { setData({ ...data, phone: val }); - if (val == "" || !(val.length >= 10 && val.length <= 15)) { + if (val == "" || !(val.length >= 9 && val.length <= 16)) { setError({ ...error, phone: true }); } else { setError({ ...error, phone: false }); diff --git a/app/(application)/member/create.tsx b/app/(application)/member/create.tsx index 48631d8..1fba8e9 100644 --- a/app/(application)/member/create.tsx +++ b/app/(application)/member/create.tsx @@ -117,7 +117,7 @@ export default function CreateMember() { } } else if (cat == "phone") { setDataForm({ ...dataForm, phone: val }); - if (val == "" || !(val.length >= 10 && val.length <= 15)) { + if (val == "" || !(val.length >= 9 && val.length <= 16)) { setError({ ...error, phone: true }); } else { setError({ ...error, phone: false }); diff --git a/app/(application)/member/edit/[id].tsx b/app/(application)/member/edit/[id].tsx index 55c0d9f..8d2d7e5 100644 --- a/app/(application)/member/edit/[id].tsx +++ b/app/(application)/member/edit/[id].tsx @@ -149,7 +149,7 @@ export default function EditMember() { } } else if (cat == "phone") { setData({ ...data, phone: val }); - if (val == "" || !(val.length >= 10 && val.length <= 15)) { + if (val == "" || !(val.length >= 9 && val.length <= 16)) { setError({ ...error, phone: true }); } else { setError({ ...error, phone: false });