fix: support async searchParams for Next.js 16 and bypass locking for admin users

This commit is contained in:
2026-07-08 11:38:15 +03:00
parent fe6bb264b0
commit 9edf6ac794
5 changed files with 17 additions and 12 deletions
+2 -1
View File
@@ -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) });
}
+2 -1
View File
@@ -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"
)
);