fix(commission) : replace repeated notification buttons with entry prompt
This commit is contained in:
@@ -16,10 +16,11 @@ const subscriptionSchema = z.object({
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
await requireCommissionUser();
|
||||
const user = await requireCommissionUser();
|
||||
const publicKey = pushPublicKey();
|
||||
if (!publicKey) throw new HttpError(503, "push-not-configured");
|
||||
return Response.json({ publicKey }, { headers: { "Cache-Control": "no-store" } });
|
||||
return Response.json({ publicKey, canAdmin: user.role === "admin" && user.emailVerified },
|
||||
{ headers: { "Cache-Control": "no-store" } });
|
||||
} catch (cause) { return errorResponse(cause); }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user