fix more nits

This commit is contained in:
msukkari 2025-02-13 16:20:01 -08:00
parent 674511a2bb
commit fbd3e41652
8 changed files with 13 additions and 13 deletions

View file

@ -18,7 +18,7 @@ import { stripe } from "@/lib/stripe"
import { getUser } from "@/data/user"; import { getUser } from "@/data/user";
import { Session } from "next-auth"; import { Session } from "next-auth";
import { STRIPE_PRODUCT_ID } from "@/lib/environment"; import { STRIPE_PRODUCT_ID } from "@/lib/environment";
import Stripe from "stripe";
const ajv = new Ajv({ const ajv = new Ajv({
validateFormats: false, validateFormats: false,
}); });
@ -546,7 +546,7 @@ export const getCustomerPortalSessionLink = async (domain: string): Promise<stri
return portalSession.url; return portalSession.url;
})); }));
export const fetchSubscription = (domain: string): Promise<any | ServiceError> => export const fetchSubscription = (domain: string): Promise<Stripe.Subscription | ServiceError> =>
withAuth(async () => { withAuth(async () => {
const org = await prisma.org.findUnique({ const org = await prisma.org.findUnique({
where: { where: {
@ -650,7 +650,7 @@ export const removeMember = async (memberId: string, domain: string): Promise<{
export const getSubscriptionData = async (domain: string) => export const getSubscriptionData = async (domain: string) =>
withAuth(async (session) => withAuth(async (session) =>
withOrgMembership(session, domain, async (orgId) => { withOrgMembership(session, domain, async () => {
const subscription = await fetchSubscription(domain); const subscription = await fetchSubscription(domain);
if (isServiceError(subscription)) { if (isServiceError(subscription)) {
return orgInvalidSubscription(); return orgInvalidSubscription();

View file

@ -30,7 +30,7 @@ export const ConnectionIcon = ({
className={cn("rounded-full w-8 h-8", className)} className={cn("rounded-full w-8 h-8", className)}
/> />
}, [type]); }, [className, type]);
return Icon; return Icon;
} }

View file

@ -41,7 +41,7 @@ export const SecretsTable = ({ initialSecrets }: SecretsTableProps) => {
useEffect(() => { useEffect(() => {
fetchSecretKeys(); fetchSecretKeys();
}, []); }, [fetchSecretKeys]);
const form = useForm<z.infer<typeof formSchema>>({ const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema), resolver: zodResolver(formSchema),

View file

@ -1,5 +1,5 @@
import type { Metadata } from "next" import type { Metadata } from "next"
import { CalendarIcon, CreditCard, DollarSign, Users } from "lucide-react" import { CalendarIcon, DollarSign, Users } from "lucide-react"
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card" import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"
import { Separator } from "@/components/ui/separator" import { Separator } from "@/components/ui/separator"

View file

@ -1,7 +1,7 @@
import { ErrorPage } from "../components/errorPage"; import { ErrorPage } from "../components/errorPage";
import { auth } from "@/auth"; import { auth } from "@/auth";
import { getUser } from "@/data/user"; import { getUser } from "@/data/user";
import { createOrg, switchActiveOrg, fetchStripeSession } from "../../../actions"; import { createOrg, fetchStripeSession } from "../../../actions";
import { isServiceError } from "@/lib/utils"; import { isServiceError } from "@/lib/utils";
import { redirect } from 'next/navigation'; import { redirect } from 'next/navigation';

View file

@ -3,7 +3,7 @@
import { checkIfOrgDomainExists } from "../../../actions" import { checkIfOrgDomainExists } from "../../../actions"
import { Button } from "@/components/ui/button" import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input" import { Input } from "@/components/ui/input"
import { Form, FormField, FormItem, FormLabel, FormControl, FormDescription, FormMessage } from "@/components/ui/form" import { Form, FormField, FormItem, FormLabel, FormControl, FormMessage } from "@/components/ui/form"
import { isServiceError } from "@/lib/utils" import { isServiceError } from "@/lib/utils"
import { useForm } from "react-hook-form" import { useForm } from "react-hook-form"
import { z } from "zod" import { z } from "zod"
@ -77,7 +77,7 @@ export function OrgCreateForm({ setOrgCreateData }: OrgCreateFormProps) {
priority={true} priority={true}
/> />
</div> </div>
<h1 className="text-2xl font-bold">Let's create your organization</h1> <h1 className="text-2xl font-bold">Let&apos;s create your organization</h1>
<Form {...form}> <Form {...form}>
<form onSubmit={form.handleSubmit(submitOrgInfoForm)} className="space-y-8"> <form onSubmit={form.handleSubmit(submitOrgInfoForm)} className="space-y-8">
<FormField <FormField

View file

@ -19,7 +19,7 @@ export default function Onboarding() {
} }
redirectIfNotAuthed(); redirectIfNotAuthed();
}, []); }, [router]);
return ( return (
<div className="flex flex-col justify-center items-center h-screen"> <div className="flex flex-col justify-center items-center h-screen">

View file

@ -71,7 +71,7 @@ export default async function RedeemPage({ searchParams }: RedeemPageProps) {
if (user) { if (user) {
if (user.email !== invite.recipientEmail) { if (user.email !== invite.recipientEmail) {
return ( return (
<ErrorLayout title={`This invite doesn't belong to you. You're currenly signed in with ${user.email}`} /> <ErrorLayout title={`This invite doesn&apos;t belong to you. You&apos;re currenly signed in with ${user.email}`} />
) )
} else { } else {
const org = await prisma.org.findUnique({ const org = await prisma.org.findUnique({
@ -80,7 +80,7 @@ export default async function RedeemPage({ searchParams }: RedeemPageProps) {
if (!org) { if (!org) {
return ( return (
<ErrorLayout title="This organization wasn't found. Please contact your organization owner." /> <ErrorLayout title="This organization wasn&apos;t found. Please contact your organization owner." />
) )
} }
@ -89,7 +89,7 @@ export default async function RedeemPage({ searchParams }: RedeemPageProps) {
const subscription = await fetchSubscription(org.domain); const subscription = await fetchSubscription(org.domain);
if (isServiceError(subscription)) { if (isServiceError(subscription)) {
return ( return (
<ErrorLayout title="This organization's subscription has expired. Please renew the subscription and try again." /> <ErrorLayout title="This organization&apos;s subscription has expired. Please renew the subscription and try again." />
) )
} }
} }