Skip to content

Commit

Permalink
Revert "feat/search: Added search bar and other minor ui fix" (#1427)
Browse files Browse the repository at this point in the history
This reverts commit 700e6b1.
  • Loading branch information
devsargam authored Oct 4, 2024
1 parent 0676efc commit c6dff34
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
16 changes: 0 additions & 16 deletions src/app/api/search/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import db from '@/db';
import { CourseContent } from '@prisma/client';
import Fuse from 'fuse.js';
import { NextRequest, NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/lib/auth';

export type TSearchedVideos = {
id: number;
Expand All @@ -26,7 +24,6 @@ const fuzzySearch = (videos: TSearchedVideos[], searchQuery: string) => {
export async function GET(request: NextRequest) {
const { searchParams } = new URL(request.url);
const searchQuery = searchParams.get('q');
const session = await getServerSession(authOptions);

if (searchQuery && searchQuery.length > 2) {
const value: TSearchedVideos[] = await cache.get(
Expand All @@ -42,19 +39,6 @@ export async function GET(request: NextRequest) {
where: {
type: 'video',
hidden: false,
parent: {
courses: {
some: {
course: {
purchasedBy: {
some: {
userId: session?.user?.id,
},
},
},
},
},
},
},
select: {
id: true,
Expand Down
6 changes: 1 addition & 5 deletions src/app/courses/[courseId]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { QueryParams } from '@/actions/types';
import SearchBar from '@/components/search/SearchBar';
import { Sidebar } from '@/components/Sidebar';
import { getFullCourseContent } from '@/db/course';
import { authOptions } from '@/lib/auth';
Expand Down Expand Up @@ -50,10 +49,7 @@ const Layout = async ({

return (
<div className="relative flex min-h-screen flex-col py-24">
<div className="flex justify-between gap-8">
<SearchBar />
<Sidebar fullCourseContent={fullCourseContent} courseId={courseId} />
</div>
<Sidebar fullCourseContent={fullCourseContent} courseId={courseId} />
{children}
</div>
);
Expand Down

0 comments on commit c6dff34

Please sign in to comment.