Skip to content

Commit

Permalink
comment out inSearchCreditsDb and user.id from search api
Browse files Browse the repository at this point in the history
  • Loading branch information
dokmy committed Jan 15, 2024
1 parent 2618ad1 commit 64098cc
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/app/api/search/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ export async function POST(req: Request) {
return new NextResponse("Unauthorized", {status: 401})
}

const inSearchCreditsDb = await checkSearchCredits(userId)
// const inSearchCreditsDb = await checkSearchCredits(userId)

if (!inSearchCreditsDb) {
return new NextResponse("Not inside credits database", {status: 401})
}
// if (!inSearchCreditsDb) {
// return new NextResponse("Not inside credits database", {status: 401})
// }

const creditsLeft = await getSearchCreditCount(userId)

Expand All @@ -76,10 +76,10 @@ export async function POST(req: Request) {
const { filters, searchQuery, selectedMinDate, selectedMaxDate, sortOption } = await req.json()

// -------Get User Info-------
const user = await currentUser();
if (!user || !user.id || !user.firstName) {
return new NextResponse("Unauthorized", { status: 401 });
}
// const user = await currentUser();
// if (!user || !user.id || !user.firstName) {
// return new NextResponse("Unauthorized", { status: 401 });
// }

// -------Check Subscription-------

Expand All @@ -92,7 +92,7 @@ export async function POST(req: Request) {
prefixFilters: JSON.stringify(filters),
minDate: selectedMinDate,
maxDate: selectedMaxDate,
userId: user.id
userId: userId
}
});

Expand Down Expand Up @@ -185,7 +185,7 @@ export async function POST(req: Request) {
caseDate: result.case_date,
caseUrl: result.url,
searchId: searchRecord.id,
userId: user.id
userId: userId
}
})
}))
Expand Down

0 comments on commit 64098cc

Please sign in to comment.