shellphone.app/app/settings/queries/get-subscription.ts
2021-09-27 06:44:26 +08:00

10 lines
250 B
TypeScript

import type { Ctx } from "blitz";
import db from "db";
export default async function getCurrentUser(_ = null, { session }: Ctx) {
if (!session.orgId) return null;
return db.subscription.findFirst({ where: { organizationId: session.orgId } });
}