Skip to content

Commit

Permalink
Remove CV URL
Browse files Browse the repository at this point in the history
  • Loading branch information
salimi-my committed Feb 5, 2024
1 parent 230ccf2 commit 1bdf47f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 28 deletions.
12 changes: 1 addition & 11 deletions app/api/miscellaneous/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export async function POST(req: Request) {
twitterUrl,
linkedinUrl,
githubUrl,
cvUrl,
titles
} = body;

Expand Down Expand Up @@ -94,13 +93,6 @@ export async function POST(req: Request) {
);
}

if (!cvUrl) {
return NextResponse.json(
{ success: false, error: 'CSV URL is required.' },
{ status: 400 }
);
}

if (titles.length < 1) {
return NextResponse.json(
{ success: false, error: 'Titles is required.' },
Expand Down Expand Up @@ -136,8 +128,7 @@ export async function POST(req: Request) {
instagramUrl,
twitterUrl,
linkedinUrl,
githubUrl,
cvUrl
githubUrl
}
});

Expand Down Expand Up @@ -172,7 +163,6 @@ export async function POST(req: Request) {
twitterUrl,
linkedinUrl,
githubUrl,
cvUrl,
userId: user.id
}
});
Expand Down
17 changes: 1 addition & 16 deletions components/admin/miscellaneous-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const formSchema = z.object({
twitterUrl: z.string().url({ message: 'Please enter valid Twitter URL.' }),
linkedinUrl: z.string().url({ message: 'Please enter valid LinkedIn URL.' }),
githubUrl: z.string().url({ message: 'Please enter valid GitHub URL.' }),
cvUrl: z.string().url({ message: 'Please enter valid CV URL.' }),
titles: z
.array(
z.object({
Expand Down Expand Up @@ -85,7 +84,6 @@ export default function MiscellaneousForm({
twitterUrl: miscellaneous?.twitterUrl ?? '',
linkedinUrl: miscellaneous?.linkedinUrl ?? '',
githubUrl: miscellaneous?.githubUrl ?? '',
cvUrl: miscellaneous?.cvUrl ?? '',
titles: initialValues
},
mode: 'onChange'
Expand Down Expand Up @@ -144,7 +142,7 @@ export default function MiscellaneousForm({
control={form.control}
name='email'
render={({ field }) => (
<FormItem className='space-y-1 lg:col-span-2'>
<FormItem className='space-y-1'>
<FormLabel>Email</FormLabel>
<FormControl>
<Input
Expand Down Expand Up @@ -274,19 +272,6 @@ export default function MiscellaneousForm({
</FormItem>
)}
/>
<FormField
control={form.control}
name='cvUrl'
render={({ field }) => (
<FormItem className='space-y-1'>
<FormLabel>CSV URL</FormLabel>
<FormControl>
<Input placeholder='Enter CV URL' {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<div className='lg:col-span-2 mt-6'>
{fields.map((field, index) => (
<div
Expand Down
1 change: 0 additions & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ model Miscellaneous {
twitterUrl String
linkedinUrl String
githubUrl String
cvUrl String
userId String @unique
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
Expand Down

0 comments on commit 1bdf47f

Please sign in to comment.