Skip to content

Commit

Permalink
Update feed api
Browse files Browse the repository at this point in the history
  • Loading branch information
thebkht committed Oct 24, 2023
1 parent 2face03 commit 016a747
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/api/feed/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NextRequest, NextResponse } from 'next/server'

export async function GET(req: NextRequest, res: NextResponse) {
try {
const user_id = Number(req.nextUrl.searchParams.get('user'))
const user_id = req.nextUrl.searchParams.get('user') as string
let page = parseInt(req.nextUrl.searchParams.get('page') || '0', 10)
let limit = 10
let offset = 0
Expand Down Expand Up @@ -36,9 +36,7 @@ export async function GET(req: NextRequest, res: NextResponse) {
const feed = await postgres.post.findMany({
where: {
authorId: {
in: [
Number(userFollowings.map((user) => user.followingId)),
],
in: userFollowings.map((user) => user.followingId),
},
},
orderBy: {
Expand Down

0 comments on commit 016a747

Please sign in to comment.