Something went wrong. Try again.
FlockOff is a mass-block tool for the Atmosphere flockoff.app
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637import { fetchEngagement } from '@/lib/engagement'import { requireSession } from '@/lib/session'
// Fetch all engagement data for a post URL.// Always fetches all engagement types; the UI does client-side filtering.export async function GET(request: Request) { const { searchParams } = new URL(request.url) const url = searchParams.get('url')
if (!url) { return Response.json({ error: 'url is required' }, { status: 400 }) }
let session: { did: string } try { session = await requireSession() } catch { return Response.json({ error: 'Not authenticated' }, { status: 401 }) }
try { const data = await fetchEngagement(url, session.did, { blockOp: true, blockLikes: true, blockReposts: true, blockQuotes: true, blockReplies: true, })
return Response.json(data) } catch (err) { const message = err instanceof Error ? err.message : 'Failed to fetch post' console.error('[api/post]', message) return Response.json({ error: message }, { status: 400 }) }}