forked from hikmet4434/winninghunter
fix: support async searchParams for Next.js 16 and bypass locking for admin users
This commit is contained in:
@@ -14,5 +14,6 @@ export async function GET(_: Request, context: { params: Promise<{ id: string }>
|
||||
});
|
||||
if (!ad) return NextResponse.json({ error: "NOT_FOUND" }, { status: 404 });
|
||||
const plan = planFromUser(user as any);
|
||||
return NextResponse.json({ data: maskAdForPlan(ad as any, plan?.code) });
|
||||
const isAdmin = user.role === "ADMIN";
|
||||
return NextResponse.json({ data: maskAdForPlan(ad as any, plan?.code, isAdmin) });
|
||||
}
|
||||
|
||||
@@ -79,7 +79,8 @@ export async function GET(req: Request) {
|
||||
thumbnailUrl: ad.creatives[0]?.thumbnailUrl || ad.creatives[0]?.url,
|
||||
isSaved: savedIds.has(ad.id)
|
||||
},
|
||||
plan?.code
|
||||
plan?.code,
|
||||
user.role === "ADMIN"
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user