feat: add plan stacking
This commit is contained in:
@@ -115,7 +115,7 @@ export const account = new Elysia({ prefix: "/account" })
|
||||
.use(requireAuth)
|
||||
|
||||
.get("/settings", async ({ accountId }) => {
|
||||
const [acc] = await sql`SELECT id, email_hash, plan, plan_expires_at, created_at FROM accounts WHERE id = ${accountId}`;
|
||||
const [acc] = await sql`SELECT id, email_hash, plan, plan_expires_at, plan_stack, created_at FROM accounts WHERE id = ${accountId}`;
|
||||
const keys = await sql`SELECT id, key, label, created_at, last_used_at FROM api_keys WHERE account_id = ${accountId} ORDER BY created_at DESC`;
|
||||
const [{ count: monitorCount }] = await sql`SELECT COUNT(*)::int as count FROM monitors WHERE account_id = ${accountId}`;
|
||||
const limits = getPlanLimits(acc.plan);
|
||||
@@ -124,6 +124,7 @@ export const account = new Elysia({ prefix: "/account" })
|
||||
has_email: !!acc.email_hash,
|
||||
plan: acc.plan,
|
||||
plan_expires_at: acc.plan_expires_at,
|
||||
plan_stack: acc.plan_stack || [],
|
||||
monitor_count: monitorCount,
|
||||
limits,
|
||||
created_at: acc.created_at,
|
||||
|
||||
Reference in New Issue
Block a user