From 5b6e94378dce751da5be2afa5ab6b2847eb43992 Mon Sep 17 00:00:00 2001
From: Ashm Walia <ashmwalia@outlook.com>
Date: Fri, 22 Jan 2021 15:37:34 -0800
Subject: Done

---
 src/screens/profile/EditProfile.tsx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'src/screens/profile/EditProfile.tsx')

diff --git a/src/screens/profile/EditProfile.tsx b/src/screens/profile/EditProfile.tsx
index 3bf5c23c..c5cf4a59 100644
--- a/src/screens/profile/EditProfile.tsx
+++ b/src/screens/profile/EditProfile.tsx
@@ -264,6 +264,7 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => {
 
   const handleClassYearUpdate = (value: string) => {
     const classYear = Number.parseInt(value);
+    console.log(classYear);
     setForm({
       ...form,
       classYear,
@@ -352,7 +353,13 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => {
     }
 
     if (form.classYear !== university_class) {
-      request.append('university_class', form.classYear);
+      console.log(form.classYear);
+      if (!form.classYear) {
+        invalidFields = true;
+        Alert.alert('Please select a valid class year');
+      } else {
+        request.append('university_class', form.classYear);
+      }
     }
 
     if (invalidFields) {
-- 
cgit v1.2.3-70-g09d2

