shellphone.app/app/settings/queries/get-subscription.ts

10 lines
263 B
TypeScript
Raw Normal View History

2021-09-30 22:59:35 +00:00
import { resolver } from "blitz";
2021-09-26 22:44:26 +00:00
import db from "db";
2021-09-30 22:59:35 +00:00
export default resolver.pipe(resolver.authorize(), async (_ = null, { session }) => {
2021-09-26 22:44:26 +00:00
if (!session.orgId) return null;
return db.subscription.findFirst({ where: { organizationId: session.orgId } });
2021-09-30 22:59:35 +00:00
});