s22
parent
f633208d8e
commit
bfaba20dbc
|
@ -39,7 +39,7 @@ export async function GET(
|
|||
}
|
||||
|
||||
const candidate = await Candidate.findById(id);
|
||||
|
||||
console.log('candidatefff', candidate)
|
||||
if (!candidate) {
|
||||
throw new Error('Candidate not found in MongoDB');
|
||||
}
|
||||
|
|
|
@ -5,42 +5,15 @@ import Link from "next/link";
|
|||
import { useRouter } from "next/navigation";
|
||||
import MainLayout from "@/components/layout/MainLayout";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle,} from "@/components/ui/card";
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow,} from "@/components/ui/table";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue,} from "@/components/ui/select";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import { format } from "date-fns";
|
||||
import { toast } from "sonner";
|
||||
import {
|
||||
ChevronLeft,
|
||||
ChevronRight,
|
||||
Download,
|
||||
Filter,
|
||||
PlusCircle,
|
||||
Search,
|
||||
SlidersHorizontal,
|
||||
} from "lucide-react";
|
||||
import { ChevronLeft, ChevronRight, Download, Filter, PlusCircle, Search, SlidersHorizontal,} from "lucide-react";
|
||||
|
||||
interface Candidate {
|
||||
_id: string;
|
||||
|
|
|
@ -7,24 +7,10 @@ import { useForm } from "react-hook-form";
|
|||
import { z } from "zod";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
FormDescription,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
} from "@/components/ui/form";
|
||||
import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage,} from "@/components/ui/form";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { toast } from "sonner";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue,} from "@/components/ui/select";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { ICandidate } from "@/models/Candidate";
|
||||
|
|
|
@ -181,4 +181,5 @@ CandidateSchema.index({ visaStatus: 1 });
|
|||
CandidateSchema.index({ currentStatus: 1 });
|
||||
CandidateSchema.index({ marketingStartDate: -1 });
|
||||
|
||||
export const Candidate = mongoose.models.Candidate || mongoose.model<ICandidate>('Candidate', CandidateSchema);
|
||||
// export const Candidate = mongoose.models.Candidate || mongoose.model<ICandidate>('Candidate', CandidateSchema);
|
||||
export const Candidate = mongoose.models.Candidate || mongoose.model<ICandidate>('Candidate', CandidateSchema, 'candidate');
|
||||
|
|
Loading…
Reference in New Issue