eslint fix
This commit is contained in:
@@ -41,7 +41,7 @@ export default async function syncAnalysisGroups() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
console.info('Getting latest public message id');
|
console.info('Getting latest public message id');
|
||||||
const lastCheckedDate = await getLastCheckedDate();
|
// const lastCheckedDate = await getLastCheckedDate(); never used?
|
||||||
|
|
||||||
const latestMessage = await getLatestPublicMessageListItem();
|
const latestMessage = await getLatestPublicMessageListItem();
|
||||||
if (!latestMessage) {
|
if (!latestMessage) {
|
||||||
|
|||||||
@@ -81,21 +81,19 @@ export default async function syncConnectedOnline() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let clinics;
|
|
||||||
let services;
|
|
||||||
let serviceProviders;
|
|
||||||
let jobTitleTranslations;
|
|
||||||
// Filter out "Dentas Demo OÜ" in prod or only sync "Dentas Demo OÜ" in any other environment
|
// Filter out "Dentas Demo OÜ" in prod or only sync "Dentas Demo OÜ" in any other environment
|
||||||
const isDemoClinic = (clinicId: number) =>
|
const isDemoClinic = (clinicId: number) =>
|
||||||
isProd ? clinicId !== 2 : clinicId === 2;
|
isProd ? clinicId !== 2 : clinicId === 2;
|
||||||
clinics = responseData.Data.T_Lic.filter(({ ID }) => isDemoClinic(ID));
|
const clinics = responseData.Data.T_Lic.filter(({ ID }) =>
|
||||||
services = responseData.Data.T_Service.filter(({ ClinicID }) =>
|
isDemoClinic(ID),
|
||||||
|
);
|
||||||
|
const services = responseData.Data.T_Service.filter(({ ClinicID }) =>
|
||||||
isDemoClinic(ClinicID),
|
isDemoClinic(ClinicID),
|
||||||
);
|
);
|
||||||
serviceProviders = responseData.Data.T_Doctor.filter(({ ClinicID }) =>
|
const serviceProviders = responseData.Data.T_Doctor.filter(({ ClinicID }) =>
|
||||||
isDemoClinic(ClinicID),
|
isDemoClinic(ClinicID),
|
||||||
);
|
);
|
||||||
jobTitleTranslations = createTranslationMap(
|
const jobTitleTranslations = createTranslationMap(
|
||||||
responseData.Data.P_JobTitleTranslations.filter(({ ClinicID }) =>
|
responseData.Data.P_JobTitleTranslations.filter(({ ClinicID }) =>
|
||||||
isDemoClinic(ClinicID),
|
isDemoClinic(ClinicID),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export const POST = async (request: NextRequest) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
validateApiKey(request);
|
validateApiKey(request);
|
||||||
} catch (e) {
|
} catch {
|
||||||
return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' });
|
return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export const POST = async (request: NextRequest) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
validateApiKey(request);
|
validateApiKey(request);
|
||||||
} catch (e) {
|
} catch {
|
||||||
return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' });
|
return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export const POST = async (request: NextRequest) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
validateApiKey(request);
|
validateApiKey(request);
|
||||||
} catch (e) {
|
} catch {
|
||||||
return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' });
|
return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export const POST = async (request: NextRequest) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
validateApiKey(request);
|
validateApiKey(request);
|
||||||
} catch (e) {
|
} catch {
|
||||||
return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' });
|
return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export const POST = async (request: NextRequest) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
validateApiKey(request);
|
validateApiKey(request);
|
||||||
} catch (e) {
|
} catch {
|
||||||
return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' });
|
return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export const POST = async (request: NextRequest) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
validateApiKey(request);
|
validateApiKey(request);
|
||||||
} catch (e) {
|
} catch {
|
||||||
return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' });
|
return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export async function POST(request: NextRequest) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
validateApiKey(request);
|
validateApiKey(request);
|
||||||
} catch (e) {
|
} catch {
|
||||||
return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' });
|
return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
|
||||||
|
|
||||||
async function SiteLayout(props: React.PropsWithChildren) {
|
async function SiteLayout(props: React.PropsWithChildren) {
|
||||||
return (
|
return (
|
||||||
<div className={'flex min-h-[100vh] flex-col items-center justify-center'}>
|
<div className={'flex min-h-[100vh] flex-col items-center justify-center'}>
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { updateCustomer } from '@lib/data/customer';
|
|||||||
|
|
||||||
import { AccountSubmitData, createAuthApi } from '@kit/auth/api';
|
import { AccountSubmitData, createAuthApi } from '@kit/auth/api';
|
||||||
import { enhanceAction } from '@kit/next/actions';
|
import { enhanceAction } from '@kit/next/actions';
|
||||||
import { pathsConfig } from '@kit/shared/config';
|
|
||||||
import { getSupabaseServerClient } from '@kit/supabase/server-client';
|
import { getSupabaseServerClient } from '@kit/supabase/server-client';
|
||||||
|
|
||||||
import { UpdateAccountSchemaServer } from '../schemas/update-account.schema';
|
import { UpdateAccountSchemaServer } from '../schemas/update-account.schema';
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ export default async function AnalysisResultsPage({
|
|||||||
)}
|
)}
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
{orderedAnalysisElements ? (
|
{orderedAnalysisElements ? (
|
||||||
orderedAnalysisElements.map((element, index) => (
|
orderedAnalysisElements.map((element) => (
|
||||||
<React.Fragment key={element.analysisIdOriginal}>
|
<React.Fragment key={element.analysisIdOriginal}>
|
||||||
<Analysis element={element} />
|
<Analysis element={element} />
|
||||||
{element.results?.nestedElements?.map(
|
{element.results?.nestedElements?.map(
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { use } from 'react';
|
|
||||||
|
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
import { createI18nServerInstance } from '@/lib/i18n/i18n.server';
|
import { createI18nServerInstance } from '@/lib/i18n/i18n.server';
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export const BookingProvider: React.FC<{
|
|||||||
);
|
);
|
||||||
setTimeSlots(response.timeSlots);
|
setTimeSlots(response.timeSlots);
|
||||||
setLocations(response.locations);
|
setLocations(response.locations);
|
||||||
} catch (error) {
|
} catch {
|
||||||
setTimeSlots(null);
|
setTimeSlots(null);
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoadingTimeSlots(false);
|
setIsLoadingTimeSlots(false);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Link from 'next/link';
|
|||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
import { pathsConfig } from '@/packages/shared/src/config';
|
import { pathsConfig } from '@/packages/shared/src/config';
|
||||||
import { ComponentInstanceIcon } from '@radix-ui/react-icons';
|
import { ComponentInstanceIcon } from '@radix-ui/react-icons';
|
||||||
import { ChevronRight, HeartPulse } from 'lucide-react';
|
import { ChevronRight } from 'lucide-react';
|
||||||
|
|
||||||
import { Button } from '@kit/ui/button';
|
import { Button } from '@kit/ui/button';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { InfoTooltip } from '@/packages/shared/src/components/ui/info-tooltip';
|
import { InfoTooltip } from '@/packages/shared/src/components/ui/info-tooltip';
|
||||||
import { HeartPulse } from 'lucide-react';
|
|
||||||
|
|
||||||
import { Button } from '@kit/ui/shadcn/button';
|
import { Button } from '@kit/ui/shadcn/button';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export async function createInitialReservationAction(
|
|||||||
|
|
||||||
export async function cancelTtoBooking(bookingCode: string, clinicId: number) {
|
export async function cancelTtoBooking(bookingCode: string, clinicId: number) {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(
|
await fetch(
|
||||||
`${process.env.CONNECTED_ONLINE_URL}/${ConnectedOnlineMethodName.ConfirmedCancel}`,
|
`${process.env.CONNECTED_ONLINE_URL}/${ConnectedOnlineMethodName.ConfirmedCancel}`,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export const isValidOpenAiEnv = async () => {
|
|||||||
const client = new OpenAI();
|
const client = new OpenAI();
|
||||||
await client.models.list();
|
await client.models.list();
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} catch {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
|
|
||||||
import {
|
import { pathsConfig } from '@/packages/shared/src/config';
|
||||||
getTeamAccountSidebarConfig,
|
|
||||||
pathsConfig,
|
|
||||||
} from '@/packages/shared/src/config';
|
|
||||||
|
|
||||||
import { AppLogo } from '@kit/shared/components/app-logo';
|
import { AppLogo } from '@kit/shared/components/app-logo';
|
||||||
import { ProfileAccountDropdownContainer } from '@kit/shared/components/personal-account-dropdown-container';
|
import { ProfileAccountDropdownContainer } from '@kit/shared/components/personal-account-dropdown-container';
|
||||||
@@ -28,25 +25,6 @@ export function TeamAccountNavigationMenu(props: {
|
|||||||
[rawAccounts],
|
[rawAccounts],
|
||||||
);
|
);
|
||||||
|
|
||||||
const routes = getTeamAccountSidebarConfig(account.slug).routes.reduce<
|
|
||||||
Array<{
|
|
||||||
path: string;
|
|
||||||
label: string;
|
|
||||||
Icon?: React.ReactNode;
|
|
||||||
end?: boolean | ((path: string) => boolean);
|
|
||||||
}>
|
|
||||||
>((acc, item) => {
|
|
||||||
if ('children' in item) {
|
|
||||||
return [...acc, ...item.children];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ('divider' in item) {
|
|
||||||
return acc;
|
|
||||||
}
|
|
||||||
|
|
||||||
return [...acc, item];
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'flex w-full flex-1 justify-between'}>
|
<div className={'flex w-full flex-1 justify-between'}>
|
||||||
<div className={'flex items-center space-x-8'}>
|
<div className={'flex items-center space-x-8'}>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { useState } from 'react';
|
import { useMemo, useState } from 'react';
|
||||||
|
|
||||||
import { redirect } from 'next/navigation';
|
import { redirect } from 'next/navigation';
|
||||||
|
|
||||||
@@ -43,11 +43,13 @@ export default function TeamAccountStatistics({
|
|||||||
accountBenefitStatistics,
|
accountBenefitStatistics,
|
||||||
expensesOverview,
|
expensesOverview,
|
||||||
}: TeamAccountStatisticsProps) {
|
}: TeamAccountStatisticsProps) {
|
||||||
const currentDate = new Date();
|
const date = useMemo<DateRange | undefined>(() => {
|
||||||
const [date, setDate] = useState<DateRange | undefined>({
|
const currentDate = new Date();
|
||||||
from: new Date(currentDate.getFullYear(), currentDate.getMonth(), 1),
|
return {
|
||||||
to: new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0),
|
from: new Date(currentDate.getFullYear(), currentDate.getMonth(), 1),
|
||||||
});
|
to: new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0),
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
const {
|
const {
|
||||||
i18n: { language },
|
i18n: { language },
|
||||||
} = useTranslation();
|
} = useTranslation();
|
||||||
|
|||||||
@@ -397,7 +397,7 @@ export async function readPrivateMessageResponse({
|
|||||||
try {
|
try {
|
||||||
analysisOrder = await getAnalysisOrder({ analysisOrderId });
|
analysisOrder = await getAnalysisOrder({ analysisOrderId });
|
||||||
medusaOrderId = analysisOrder.medusa_order_id;
|
medusaOrderId = analysisOrder.medusa_order_id;
|
||||||
} catch (e) {
|
} catch {
|
||||||
if (IS_ENABLED_DELETE_PRIVATE_MESSAGE) {
|
if (IS_ENABLED_DELETE_PRIVATE_MESSAGE) {
|
||||||
await deletePrivateMessage(privateMessageId);
|
await deletePrivateMessage(privateMessageId);
|
||||||
}
|
}
|
||||||
@@ -571,7 +571,6 @@ export async function sendOrderToMedipost({
|
|||||||
phone: account.phone ?? '',
|
phone: account.phone ?? '',
|
||||||
},
|
},
|
||||||
orderId: medreportOrder.id,
|
orderId: medreportOrder.id,
|
||||||
orderCreatedAt: new Date(medreportOrder.created_at),
|
|
||||||
comment: '',
|
comment: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ export async function composeOrderXML({
|
|||||||
analysisElements,
|
analysisElements,
|
||||||
person,
|
person,
|
||||||
orderId,
|
orderId,
|
||||||
orderCreatedAt,
|
|
||||||
comment,
|
comment,
|
||||||
}: {
|
}: {
|
||||||
analyses: AnalysesWithGroupsAndElements;
|
analyses: AnalysesWithGroupsAndElements;
|
||||||
@@ -45,7 +44,6 @@ export async function composeOrderXML({
|
|||||||
phone: string;
|
phone: string;
|
||||||
};
|
};
|
||||||
orderId: number;
|
orderId: number;
|
||||||
orderCreatedAt: Date;
|
|
||||||
comment?: string;
|
comment?: string;
|
||||||
}) {
|
}) {
|
||||||
const analysisGroups: Tables<{ schema: 'medreport' }, 'analysis_groups'>[] =
|
const analysisGroups: Tables<{ schema: 'medreport' }, 'analysis_groups'>[] =
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export async function renderBookTimeFailedEmail({
|
|||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Text>
|
<Text>
|
||||||
Broneeringu {reservationId} Connected Online'i saatmine ei
|
Broneeringu {reservationId} Connected Online'i saatmine ei
|
||||||
õnnestunud, kliendile tuleb teha tagasimakse.
|
õnnestunud, kliendile tuleb teha tagasimakse.
|
||||||
</Text>
|
</Text>
|
||||||
<Text>Saadud error: {error}</Text>
|
<Text>Saadud error: {error}</Text>
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export async function renderNewJobsAvailableEmail({
|
|||||||
</Text>
|
</Text>
|
||||||
<ul className="list-none text-[16px] leading-[24px]">
|
<ul className="list-none text-[16px] leading-[24px]">
|
||||||
{analysisResponseIds.map((analysisResponseId, index) => (
|
{analysisResponseIds.map((analysisResponseId, index) => (
|
||||||
<li>
|
<li key={index}>
|
||||||
<Link
|
<Link
|
||||||
key={analysisResponseId}
|
key={analysisResponseId}
|
||||||
href={`${process.env.NEXT_PUBLIC_SITE_URL}/doctor/analysis/${analysisResponseId}`}
|
href={`${process.env.NEXT_PUBLIC_SITE_URL}/doctor/analysis/${analysisResponseId}`}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { Tables } from '@kit/supabase/database';
|
|||||||
import { getSupabaseServerAdminClient } from '@kit/supabase/server-admin-client';
|
import { getSupabaseServerAdminClient } from '@kit/supabase/server-admin-client';
|
||||||
import { getSupabaseServerClient } from '@kit/supabase/server-client';
|
import { getSupabaseServerClient } from '@kit/supabase/server-client';
|
||||||
import { createTeamAccountsApi } from '@kit/team-accounts/api';
|
import { createTeamAccountsApi } from '@kit/team-accounts/api';
|
||||||
import { Alert, AlertDescription, AlertTitle } from '@kit/ui/alert';
|
|
||||||
import { AppBreadcrumbs } from '@kit/ui/app-breadcrumbs';
|
import { AppBreadcrumbs } from '@kit/ui/app-breadcrumbs';
|
||||||
import { Badge } from '@kit/ui/badge';
|
import { Badge } from '@kit/ui/badge';
|
||||||
import { Button } from '@kit/ui/button';
|
import { Button } from '@kit/ui/button';
|
||||||
@@ -12,14 +11,6 @@ import { Heading } from '@kit/ui/heading';
|
|||||||
import { If } from '@kit/ui/if';
|
import { If } from '@kit/ui/if';
|
||||||
import { PageBody, PageHeader } from '@kit/ui/page';
|
import { PageBody, PageHeader } from '@kit/ui/page';
|
||||||
import { ProfileAvatar } from '@kit/ui/profile-avatar';
|
import { ProfileAvatar } from '@kit/ui/profile-avatar';
|
||||||
import {
|
|
||||||
Table,
|
|
||||||
TableBody,
|
|
||||||
TableCell,
|
|
||||||
TableHead,
|
|
||||||
TableHeader,
|
|
||||||
TableRow,
|
|
||||||
} from '@kit/ui/table';
|
|
||||||
|
|
||||||
import { AdminBanUserDialog } from './admin-ban-user-dialog';
|
import { AdminBanUserDialog } from './admin-ban-user-dialog';
|
||||||
import { AdminDeleteAccountDialog } from './admin-delete-account-dialog';
|
import { AdminDeleteAccountDialog } from './admin-delete-account-dialog';
|
||||||
@@ -224,148 +215,6 @@ async function TeamAccountPage(props: {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function SubscriptionsTable(props: { accountId: string }) {
|
|
||||||
const client = getSupabaseServerClient();
|
|
||||||
|
|
||||||
const { data: subscription, error } = await client
|
|
||||||
.schema('medreport')
|
|
||||||
.from('subscriptions')
|
|
||||||
.select('*, subscription_items !inner (*)')
|
|
||||||
.eq('account_id', props.accountId)
|
|
||||||
.maybeSingle();
|
|
||||||
|
|
||||||
if (error) {
|
|
||||||
return (
|
|
||||||
<Alert variant={'destructive'}>
|
|
||||||
<AlertTitle>There was an error loading subscription.</AlertTitle>
|
|
||||||
|
|
||||||
<AlertDescription>
|
|
||||||
Please check the logs for more information or try again later.
|
|
||||||
</AlertDescription>
|
|
||||||
</Alert>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={'flex flex-col gap-y-1'}>
|
|
||||||
<Heading level={6}>Subscription</Heading>
|
|
||||||
|
|
||||||
<If
|
|
||||||
condition={subscription}
|
|
||||||
fallback={
|
|
||||||
<span className={'text-muted-foreground text-sm'}>
|
|
||||||
This account does not currently have a subscription.
|
|
||||||
</span>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{(subscription) => {
|
|
||||||
return (
|
|
||||||
<div className={'flex flex-col space-y-4'}>
|
|
||||||
<Table>
|
|
||||||
<TableHeader>
|
|
||||||
<TableHead>Subscription ID</TableHead>
|
|
||||||
|
|
||||||
<TableHead>Provider</TableHead>
|
|
||||||
|
|
||||||
<TableHead>Customer ID</TableHead>
|
|
||||||
|
|
||||||
<TableHead>Status</TableHead>
|
|
||||||
|
|
||||||
<TableHead>Created At</TableHead>
|
|
||||||
|
|
||||||
<TableHead>Period Starts At</TableHead>
|
|
||||||
|
|
||||||
<TableHead>Ends At</TableHead>
|
|
||||||
</TableHeader>
|
|
||||||
|
|
||||||
<TableBody>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell>
|
|
||||||
<span>{subscription.id}</span>
|
|
||||||
</TableCell>
|
|
||||||
|
|
||||||
<TableCell>
|
|
||||||
<span>{subscription.billing_provider}</span>
|
|
||||||
</TableCell>
|
|
||||||
|
|
||||||
<TableCell>
|
|
||||||
<span>{subscription.billing_customer_id}</span>
|
|
||||||
</TableCell>
|
|
||||||
|
|
||||||
<TableCell>
|
|
||||||
<span>{subscription.status}</span>
|
|
||||||
</TableCell>
|
|
||||||
|
|
||||||
<TableCell>
|
|
||||||
<span>{subscription.created_at}</span>
|
|
||||||
</TableCell>
|
|
||||||
|
|
||||||
<TableCell>
|
|
||||||
<span>{subscription.period_starts_at}</span>
|
|
||||||
</TableCell>
|
|
||||||
|
|
||||||
<TableCell>
|
|
||||||
<span>{subscription.period_ends_at}</span>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
</TableBody>
|
|
||||||
</Table>
|
|
||||||
|
|
||||||
<Table>
|
|
||||||
<TableHeader>
|
|
||||||
<TableHead>Product ID</TableHead>
|
|
||||||
|
|
||||||
<TableHead>Variant ID</TableHead>
|
|
||||||
|
|
||||||
<TableHead>Quantity</TableHead>
|
|
||||||
|
|
||||||
<TableHead>Price</TableHead>
|
|
||||||
|
|
||||||
<TableHead>Interval</TableHead>
|
|
||||||
|
|
||||||
<TableHead>Type</TableHead>
|
|
||||||
</TableHeader>
|
|
||||||
|
|
||||||
<TableBody>
|
|
||||||
{subscription.subscription_items.map((item) => {
|
|
||||||
return (
|
|
||||||
<TableRow key={item.variant_id}>
|
|
||||||
<TableCell>
|
|
||||||
<span>{item.product_id}</span>
|
|
||||||
</TableCell>
|
|
||||||
|
|
||||||
<TableCell>
|
|
||||||
<span>{item.variant_id}</span>
|
|
||||||
</TableCell>
|
|
||||||
|
|
||||||
<TableCell>
|
|
||||||
<span>{item.quantity}</span>
|
|
||||||
</TableCell>
|
|
||||||
|
|
||||||
<TableCell>
|
|
||||||
<span>{item.price_amount}</span>
|
|
||||||
</TableCell>
|
|
||||||
|
|
||||||
<TableCell>
|
|
||||||
<span>{item.interval}</span>
|
|
||||||
</TableCell>
|
|
||||||
|
|
||||||
<TableCell>
|
|
||||||
<span>{item.type}</span>
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</TableBody>
|
|
||||||
</Table>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
</If>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getMemberships(userId: string) {
|
async function getMemberships(userId: string) {
|
||||||
const client = getSupabaseServerClient();
|
const client = getSupabaseServerClient();
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export function MultiFactorChallengeContainer({
|
|||||||
try {
|
try {
|
||||||
await fetch('/api/after-mfa', { method: 'POST' });
|
await fetch('/api/after-mfa', { method: 'POST' });
|
||||||
router.replace(paths.redirectPath);
|
router.replace(paths.redirectPath);
|
||||||
} catch (err) {
|
} catch {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export function CompanyGuard<Params extends object>(
|
|||||||
Component: LayoutOrPageComponent<Params>,
|
Component: LayoutOrPageComponent<Params>,
|
||||||
) {
|
) {
|
||||||
return async function AdminGuardServerComponentWrapper(params: Params) {
|
return async function AdminGuardServerComponentWrapper(params: Params) {
|
||||||
//@ts-ignore
|
// @ts-expect-error incorrectly typed params
|
||||||
const { account } = await params.params;
|
const { account } = await params.params;
|
||||||
const client = getSupabaseServerClient();
|
const client = getSupabaseServerClient();
|
||||||
const [isUserSuperAdmin, isUserCompanyAdmin] = await Promise.all([
|
const [isUserSuperAdmin, isUserCompanyAdmin] = await Promise.all([
|
||||||
|
|||||||
@@ -149,7 +149,6 @@ export const updateInvitationAction = enhanceAction(
|
|||||||
export const acceptInvitationAction = enhanceAction(
|
export const acceptInvitationAction = enhanceAction(
|
||||||
async (data: FormData, user) => {
|
async (data: FormData, user) => {
|
||||||
const client = getSupabaseServerClient();
|
const client = getSupabaseServerClient();
|
||||||
const accountBalanceService = new AccountBalanceService();
|
|
||||||
|
|
||||||
const { inviteToken, nextPath } = AcceptInvitationSchema.parse(
|
const { inviteToken, nextPath } = AcceptInvitationSchema.parse(
|
||||||
Object.fromEntries(data),
|
Object.fromEntries(data),
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { JSX, ReactNode } from 'react';
|
import React, { JSX } from 'react';
|
||||||
|
|
||||||
import { cn } from '@kit/ui/utils';
|
import { cn } from '@kit/ui/utils';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user