(input: { userId: string })
| 211 | } |
| 212 | |
| 213 | export async function assertUserSubscribed(input: { userId: string }) { |
| 214 | if ((await dataAbstraction().hget('user', input.userId, 'plan')) !== 'pro') { |
| 215 | throw new TRPCError({ |
| 216 | code: 'FORBIDDEN', |
| 217 | message: 'This action requires a Pro plan subscription.', |
| 218 | }); |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | export async function assertNonDemoAccount(input: { userId: string }) { |
| 223 | if (await dataAbstraction().hget('user', input.userId, 'demo')) { |