Skip to content

Commit

Permalink
fix: remove nuid
Browse files Browse the repository at this point in the history
  • Loading branch information
in-mai-space committed Mar 20, 2024
1 parent ad740d4 commit c715a23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 35 deletions.
3 changes: 2 additions & 1 deletion frontend/sac-mobile/app/(auth)/_components/tag-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const TagForm = () => {
return (
<>
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
{categoriesMenu.map((category) => (
{categoriesMenu.map((category, key) => (
<View>
<Button
onPress={() => handleCategoryPress(category)}
Expand All @@ -91,6 +91,7 @@ const TagForm = () => {
? 'underline'
: 'menu'
}
key={key}
size="menu"
>
{category.name}
Expand Down
34 changes: 0 additions & 34 deletions frontend/sac-mobile/app/(auth)/user-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { Item } from '@/types/item';
type UserDetailsForm = {
major: Item[];
college: Item;
nuid: string;
graduationYear: Item;
};

Expand All @@ -35,19 +34,16 @@ const UserDetails = () => {
college: z.string(),
major: z.string().array(),
graduationYear: z.string(),
nuid: z.string().length(9, { message: 'NUID must have 9 digits' })
});

const onSubmit = ({
major,

Check warning on line 40 in frontend/sac-mobile/app/(auth)/user-details.tsx

View workflow job for this annotation

GitHub Actions / Lint

'major' is already declared in the upper scope on line 16 column 10
college,

Check warning on line 41 in frontend/sac-mobile/app/(auth)/user-details.tsx

View workflow job for this annotation

GitHub Actions / Lint

'college' is already declared in the upper scope on line 15 column 10
nuid,
graduationYear

Check warning on line 42 in frontend/sac-mobile/app/(auth)/user-details.tsx

View workflow job for this annotation

GitHub Actions / Lint

'graduationYear' is already declared in the upper scope on line 17 column 10
}: UserDetailsForm) => {
try {
const updatedData = {
major,
nuid,
graduationYear: graduationYear.value,
college: college.value
};
Expand Down Expand Up @@ -136,36 +132,6 @@ const UserDetails = () => {
<Error message={errors.graduationYear.message} />
)}
</View>
<View className="mb-[7%]">
<Controller
control={control}
render={({ field: { onChange, value } }) => (
<Input
title="NUID"
autoCorrect={false}
placeholder="9 digit student ID number"
onChangeText={onChange}
value={value}
onSubmitEditing={handleSubmit(onSubmit)}
error={!!errors.nuid}
/>
)}
name="nuid"
rules={{
required: 'NUID is required',
validate: (value) => {
if (!/^00\d+/.test(value)) {
return 'Please enter a proper NUID number';
}
if (value.length !== 9) {
return 'Please enter 9 digit number';
}
return true;
}
}}
/>
{errors.nuid && <Error message={errors.nuid.message} />}
</View>
<View className="flex-row justify-end pt-[5%]">
<Button
size="lg"
Expand Down

0 comments on commit c715a23

Please sign in to comment.