Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

remove unnecessary where clauses in query (#141)

Ben Asokanthan9f2ee14f9392
diff --git a/src/components/challenge/index.tsx b/src/components/challenge/index.tsx
index a72bfe67..566cefd5 100644
--- a/src/components/challenge/index.tsx
+++ b/src/components/challenge/index.tsx
@@ -1,4 +1,4 @@
-import { type Session, getServerSession } from 'next-auth';
+import { getServerSession, type Session } from 'next-auth';
import { notFound } from 'next/navigation';
import { prisma } from '~/server/db';
@@ -38,19 +38,16 @@ async function getChallenge(id: string, session: Session | null) {
vote: {
where: {
userId: session?.user.id,
- challengeId: +id,
},
},
bookmark: {
where: {
userId: session?.user.id,
- challengeId: +id,
},
},
solution: {
where: {
userId: session?.user.id,
- challengeId: +id,
},
orderBy: [
{
@@ -60,9 +57,6 @@ async function getChallenge(id: string, session: Session | null) {
take: 10,
},
sharedSolution: {
- where: {
- challengeId: +id,
- },
orderBy: [
{
createdAt: 'desc',