Skip to content

Commit 4a008ff

Browse files
fixed build errors
1 parent a196a61 commit 4a008ff

File tree

9 files changed

+11
-15
lines changed

9 files changed

+11
-15
lines changed

src/app/actions/get-papers-by-id.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// "use server";
2-
import { ErrorResponse, type PaperResponse } from "@/interface";
2+
import { type PaperResponse } from "@/interface";
33
import axios, { type AxiosResponse } from "axios";
44

55
export const fetchPaperID = async (id: string): Promise<PaperResponse> => {

src/app/api/ai-upload/route.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { NextResponse } from "next/server";
22
import { PDFDocument } from "pdf-lib";
33
import {
44
campuses,
5-
exams,
65
semesters,
76
slots,
87
years,
@@ -39,7 +38,7 @@ export async function POST(req: Request) {
3938
} else {
4039
const bytes = await files[0]?.arrayBuffer();
4140
if (bytes) {
42-
const buffer = await Buffer.from(bytes);
41+
const buffer = Buffer.from(bytes);
4342
imageURL = `data:${"image/png"};base64,${buffer.toString("base64")}`;
4443
}
4544
}

src/app/api/papers/count/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextResponse, NextRequest } from "next/server";
1+
import { NextResponse } from "next/server";
22
import { connectToDatabase } from "@/lib/mongoose";
33
import Paper from "@/db/papers";
44

src/app/api/papers/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { NextResponse, NextRequest } from "next/server";
1+
import { NextResponse, type NextRequest } from "next/server";
22
import { connectToDatabase } from "@/lib/mongoose";
33
import Paper from "@/db/papers";
4-
import { IPaper, type IAdminPaper } from "@/interface";
4+
import { type IPaper, } from "@/interface";
55

66
export const dynamic = "force-dynamic";
77

src/app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Toaster } from "react-hot-toast";
33
import { ThemeProvider } from "@/components/theme-provider";
44
import { GeistSans } from "geist/font/sans";
55
import Script from "next/script";
6-
import { Metadata } from "next";
6+
import type { Metadata } from "next";
77

88
export const metadata: Metadata = {
99
metadataBase: new URL("https://papers.codechefvit.com/"),

src/app/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import SearchBar from "@/components/searchbar";
22
import Navbar from "@/components/Navbar";
3-
import { Button } from "@/components/ui/button";
43
import StoredPapers from "@/components/StoredPapers";
54
import Footer from "@/components/Footer";
65

src/app/upload/page.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import { Button } from "@/components/ui/button";
77
import Navbar from "@/components/Navbar";
88
import Footer from "@/components/Footer";
99
import { type PostPDFToCloudinary } from "@/interface";
10-
import { slots, years, campuses, semesters, exams } from "@/components/select_options";
11-
import SearchBar from "@/components/searchbarSubjectList";
10+
import { years, campuses, semesters } from "@/components/select_options";
1211
import Dropzone from "react-dropzone";
1312
import {
1413
Select,
@@ -56,7 +55,7 @@ const Page = () => {
5655

5756
const [files, setFiles] = useState<File[]>([]);
5857
const [isUploading, setIsUploading] = useState(false);
59-
const [resetSearch, setResetSearch] = useState(false);
58+
const [, setResetSearch] = useState(false);
6059

6160
const handlePrint = async () => {
6261
const maxFileSize = 5 * 1024 * 1024;

src/components/Card.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const Card = ({
2121
onSelect: (paper: IPaper, isSelected: boolean) => void;
2222
isSelected: boolean;
2323
}) => {
24-
const router = useRouter();
2524
const [checked, setChecked] = useState<boolean>(false);
2625

2726
useEffect(() => {

src/util/mistral.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ function parseExamDetail(analysis: string): ExamDetail {
7878
// Try to find JSON in the response
7979
const jsonMatch = analysis.match(/\{[\s\S]*\}/);
8080
if (jsonMatch) {
81-
const examDetail = JSON.parse(jsonMatch[0]);
82-
return examDetail as ExamDetail;
81+
const examDetail: ExamDetail = JSON.parse(jsonMatch[0]) as ExamDetail;
82+
return examDetail
8383
}
8484

8585
throw new Error("Could not parse exam details from response");
@@ -139,7 +139,7 @@ async function analyzeImage(dataUrl: string): Promise<AnalysisResult[]> {
139139
}
140140

141141
const rawAnalysis = chatResponse.choices[0].message.content;
142-
const examDetail = parseExamDetail(rawAnalysis);
142+
const examDetail: ExamDetail = parseExamDetail(rawAnalysis);
143143

144144
results.push({
145145
examDetail,

0 commit comments

Comments
 (0)