Skip to content

Commit

Permalink
Merge pull request #1083 from mrsourav1/fixed/search-api-req-type
Browse files Browse the repository at this point in the history
fixed:search api req type
  • Loading branch information
siinghd authored Aug 30, 2024
2 parents cc0d5fb + 2d18f9f commit 390d08c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/app/api/search/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { cache } from '@/db/Cache';
import db from '@/db';
import { CourseContent } from '@prisma/client';
import Fuse from 'fuse.js';
import { NextResponse } from 'next/server';
import { NextRequest, NextResponse } from 'next/server';

export type TSearchedVideos = {
id: number;
Expand All @@ -21,7 +21,7 @@ const fuzzySearch = (videos: TSearchedVideos[], searchQuery: string) => {
return searchedVideos.map((video) => video.item);
};

export async function GET(request: Request) {
export async function GET(request: NextRequest) {
const { searchParams } = new URL(request.url);
const searchQuery = searchParams.get('q');

Expand Down
10 changes: 5 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
"incremental": true,
"plugins": [
{
"name": "next"
}
"name": "next",
},
],
"paths": {
"@/*": ["./src/*"],
"@public/*": ["./public/*"]
}
"@public/*": ["./public/*"],
},
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}

0 comments on commit 390d08c

Please sign in to comment.