Skip to content

Commit a88013b

Browse files
Merge pull request #9 from tierrun/intellisense
Adding type to payment method and upgraded Prisma
2 parents 2d7574e + 516ccfa commit a88013b

File tree

5 files changed

+28
-25
lines changed

5 files changed

+28
-25
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ npm run dev
5555

5656
- Prod - https://model.tier.run/clkkv3fv93bbko972m4w3x9o8
5757
- Staging - https://model.tier.run/clkkurlas3a4qo9725bj1hfr0
58-
- Dev - https://model.tier.run/clkk2dgjs30kdo972fptgizyx
58+
- Dev - https://model.tier.run/edit/cll0j0ya64mrao972ccqueu7i
59+
- Dev (New Model) - https://model.tier.run/clkk2dgjs30kdo972fptgizyx
5960

6061
You can clone the pricing model from the above links and make it your own.
6162

package-lock.json

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@headlessui/react": "^1.7.15",
1919
"@heroicons/react": "^2.0.18",
2020
"@next-auth/prisma-adapter": "^1.0.7",
21-
"@prisma/client": "^5.0.0",
21+
"@prisma/client": "^5.1.1",
2222
"@radix-ui/react-toast": "^1.1.4",
2323
"@t3-oss/env-nextjs": "^0.6.0",
2424
"ai": "^2.1.26",
@@ -62,7 +62,7 @@
6262
"prettier": "^2.8.8",
6363
"prettier-plugin-tailwindcss": "^0.3.0",
6464
"pretty-quick": "^3.1.3",
65-
"prisma": "^5.0.0",
65+
"prisma": "^5.1.1",
6666
"stripe": "^12.17.0",
6767
"tailwindcss": "^3.3.2",
6868
"tailwindcss-animate": "^1.0.6",

src/app/(app)/billing/page.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Metadata } from "next";
22
import { clsx } from "clsx";
3+
import type Stripe from "stripe";
34

45
import { TIER_AICOPY_FEATURE_ID } from "@/config/tierConstants";
56
import { pullCurrentPlan } from "@/lib/services/currentPlan";
@@ -34,6 +35,7 @@ export default async function BillingPage() {
3435

3536
// Fetch the phase data of the current subscription
3637
const phase = await tier.lookupPhase(`org:${user?.id}`);
38+
console.log(phase.current?.end);
3739

3840
// Fetch the current plan from the pricing table data
3941
const currentPlan = await pullCurrentPlan(phase, pricing);
@@ -44,7 +46,7 @@ export default async function BillingPage() {
4446
// Fetch the saved payment methods
4547
const paymentMethodResponse = await tier.lookupPaymentMethods(`org:${user?.id}`);
4648

47-
const paymentMethod = paymentMethodResponse.methods[0];
49+
const paymentMethod = paymentMethodResponse.methods[0] as unknown as Stripe.PaymentMethod;
4850

4951
return (
5052
<>
@@ -213,7 +215,7 @@ export default async function BillingPage() {
213215
</div>
214216
)}
215217
{/* Payment method */}
216-
{paymentMethod && (
218+
{paymentMethod && paymentMethod.card && (
217219
<div className="flex items-start gap-16">
218220
<p className="text-slate-11">Payment method</p>
219221
<div className="flex gap-4">

tsconfig.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"compilerOptions": {
3-
"target": "es2017",
4-
"lib": ["dom", "dom.iterable", "esnext"],
3+
"target": "ES2017",
4+
"lib": ["DOM", "DOM.Iterable", "ESNext"],
55
"allowJs": true,
66
"skipLibCheck": true,
77
"strict": true,
88
"forceConsistentCasingInFileNames": true,
99
"noEmit": true,
1010
"esModuleInterop": true,
11-
"module": "esnext",
12-
"moduleResolution": "node",
11+
"module": "ESNext",
12+
"moduleResolution": "Node",
1313
"resolveJsonModule": true,
1414
"isolatedModules": true,
1515
"jsx": "preserve",

0 commit comments

Comments
 (0)