Skip to content

Commit da16136

Browse files
committed
fix: ESLint errors
1 parent 9dc0bf9 commit da16136

32 files changed

Lines changed: 36 additions & 93 deletions

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { success, failure } from "@/lib/utils/response";
33

44
export const dynamic = "force-dynamic";
55

6-
export async function GET(req: Request) {
6+
export async function GET() {
77
try {
88
const courseCount = await getCourseCounts();
99

src/app/api/report-tag/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { reportTag, ReportTagBody } from "@/lib/services/report";
1+
import { reportTag, type ReportTagBody } from "@/lib/services/report";
22
import { rateLimitCheck } from "@/lib/utils/rate-limiter";
33
import { success, failure } from "@/lib/utils/response";
44
import { customErrorHandler } from "@/lib/utils/error";

src/app/api/user-papers/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { connectToDatabase } from "@/lib/database/mongoose";
22
import Paper from "@/db/papers";
3-
import { StoredSubjects } from "@/interface";
3+
import { type StoredSubjects } from "@/interface";
44
import { transformPapersToSubjectSlots } from "@/lib/services/paper-transform";
55
import { success, failure } from "@/lib/utils/response";
66

src/app/pinned/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from "react";
22
import SearchBar from "@/components/Searchbar/searchbar";
3-
import PinnedPapersCarousel from "@/components/PinnedPapersCarousel";
43

54
const Pinned = () => {
65
return (

src/app/request/page.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,13 @@ import { Input } from "@/components/ui/input";
1414
import axios from "axios";
1515
import Fuse from "fuse.js";
1616
import { type IUpcomingPaper } from "@/interface";
17-
import { Skeleton } from "../../components/ui/skeleton";
1817
import UpcomingPaper from "../../components/UpcomingPaper";
1918
import toast from "react-hot-toast";
2019
import { Search } from "lucide-react";
2120
import SkeletonPaperCard from "@/components/SkeletonPaperCard";
2221
import { useCourses } from "@/context/courseContext";
2322
import { type ApiResponse } from '@/interface'
2423

25-
type Course = {
26-
name?: string | null;
27-
courseName?: string | null;
28-
title?: string | null;
29-
};
30-
3124
export default function PaperRequest() {
3225
const [subjects, setSubjects] = useState<string[]>([]);
3326
const [searchText, setSearchText] = useState("");
@@ -39,7 +32,7 @@ export default function PaperRequest() {
3932
const suggestionsRef = useRef<HTMLUListElement | null>(null);
4033
const [displayPapers, setDisplayPapers] = useState<IUpcomingPaper[]>([]);
4134
const [isLoading, setIsLoading] = useState(true);
42-
const { courses, loading, error, refetch } = useCourses();
35+
const { courses } = useCourses();
4336

4437
useEffect(() => {
4538
setSubjects(courses.map((course) => course.name));

src/app/upload/page.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -433,11 +433,7 @@ export default function Page() {
433433
}}
434434
multiple={true}
435435
>
436-
{({ getRootProps, getInputProps, isDragActive }) => {
437-
const pdfUploaded = files.some(
438-
(f) => f.type === "application/pdf",
439-
);
440-
436+
{({ getRootProps, getInputProps }) => {
441437
return (
442438
<section
443439
{...getRootProps()}

src/components/CatalogueContent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useSearchParams } from "next/navigation";
44
import { useEffect, useState } from "react";
5-
import axios, { type AxiosError } from "axios";
5+
import axios from "axios";
66
import { Button } from "@/components/ui/button";
77
import { type IPaper, type Filters, type StoredSubjects, type ApiResponse } from "@/interface";
88
import Card from "./Card";
@@ -64,7 +64,7 @@ const CatalogueContentInner = ({ subject }: { subject: string | null }) => {
6464

6565
useEffect(() => {
6666
setCurrentPage(1);
67-
}, [subject]);
67+
}, [subject, setCurrentPage]);
6868

6969
// Fetch related subjects when subject changes
7070
useEffect(() => {

src/components/FloatingNavbar.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import { usePathname } from "next/navigation";
44
import Link from "next/link";
55
import { useState } from "react";
66
import {
7-
ArrowUpRight,
87
ChevronDown,
9-
Pin,
108
UploadIcon,
119
} from "lucide-react";
1210
import ModeToggle from "./toggle-theme";

src/components/Footer.tsx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
"use client";
22

33
import Link from "next/link";
4-
import { useTheme } from "next-themes";
5-
import { useEffect, useState } from "react";
4+
import { useState } from "react";
65
import { Button } from "./ui/button";
76
import { Input } from "@/components/ui/input";
87
import {
@@ -13,24 +12,12 @@ import {
1312
FaXTwitter,
1413
FaYoutube,
1514
} from "react-icons/fa6";
16-
import { Bold, Mail } from "lucide-react";
15+
import { Mail } from "lucide-react";
1716
import toast from "react-hot-toast";
1817
import type { ApiResponse } from '@/interface'
1918

20-
type SubscribeResponse = {
21-
success?: boolean;
22-
message?: string;
23-
};
24-
2519
export default function Footer() {
26-
const { theme } = useTheme();
27-
const [isDarkMode, setIsDarkMode] = useState<boolean | null>(true);
2820
const [email, setEmail] = useState("");
29-
useEffect(() => {
30-
if (theme) {
31-
setIsDarkMode(theme === "dark");
32-
}
33-
}, [theme]);
3421
const handleSubscribe = async () => {
3522
if (!email.trim()) {
3623
toast.error("Please enter your email.");

src/components/Navbar.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
"use client";
22

33
import { useState, useEffect } from "react";
4-
import Image, { StaticImageData } from "next/image";
4+
import Image, { type StaticImageData } from "next/image";
55
import Link from "next/link";
66
import { usePathname } from "next/navigation";
77
import ccLogo from "../assets/codechef_logo.svg";
88
import ModeToggle from "@/components/toggle-theme";
99
import {
1010
ArrowDownLeftIcon,
11-
Pin,
12-
ArrowUpRight,
1311
ChevronDown,
1412
} from "lucide-react";
1513
import FloatingNavbar from "./FloatingNavbar";
1614
import PWAInstallButton from "./ui/PWAInstallButton";
1715
import SearchBarChild from "./Searchbar/searchbar-child";
18-
import Banner from "@/components/ui/banners/bannerDismiss";
19-
import type { ICourses } from "@/interface";
2016
import {
2117
DropdownMenu,
2218
DropdownMenuTrigger,
@@ -32,7 +28,7 @@ function Navbar() {
3228
const pathname: string = usePathname() ?? "/";
3329

3430
const [dropdownOpen, setDropdownOpen] = useState<boolean>(false);
35-
const { courses, loading, error, refetch } = useCourses();
31+
const { courses } = useCourses();
3632

3733
useEffect(() => {
3834
if (pathname !== "/catalogue") return;

0 commit comments

Comments
 (0)