From 17e7a98534c36784d9b19789d7ec9bbded292d5c Mon Sep 17 00:00:00 2001 From: Danel Kungla Date: Tue, 7 Oct 2025 18:43:42 +0300 Subject: [PATCH] eslint fix --- app/api/job/handler/sync-analysis-groups.ts | 2 +- app/api/job/handler/sync-connected-online.ts | 14 +- app/api/job/medipost-retry-dispatch/route.ts | 2 +- app/api/job/send-open-jobs-emails/route.ts | 2 +- .../job/sync-analysis-groups-store/route.ts | 2 +- app/api/job/sync-analysis-groups/route.ts | 2 +- app/api/job/sync-analysis-results/route.ts | 2 +- app/api/job/sync-connected-online/route.ts | 2 +- app/api/job/test-medipost-responses/route.ts | 2 +- app/auth/membership-confirmation/layout.tsx | 2 - .../_lib/server/update-account.ts | 1 - .../analysis-results/[id]/page.tsx | 2 +- .../cart/montonio-callback/error/page.tsx | 2 - .../_components/booking/booking.provider.tsx | 2 +- app/home/(user)/_components/order-cards.tsx | 2 +- .../_components/recommendations-skeleton.tsx | 1 - app/home/(user)/_lib/server/actions.ts | 2 +- .../_lib/server/is-valid-open-ai-env.ts | 2 +- .../team-account-navigation-menu.tsx | 24 +-- .../_components/team-account-statistics.tsx | 14 +- .../medipostPrivateMessage.service.ts | 3 +- lib/services/medipost/medipostXML.service.ts | 2 - .../src/emails/book-time-failed.email.tsx | 2 +- .../src/emails/new-jobs-available.email.tsx | 2 +- .../src/components/admin-account-page.tsx | 151 ------------------ .../multi-factor-challenge-container.tsx | 2 +- .../src/components/company-guard.tsx | 2 +- .../team-invitations-server-actions.ts | 1 - packages/shared/src/components/ui/search.tsx | 2 +- 29 files changed, 34 insertions(+), 217 deletions(-) diff --git a/app/api/job/handler/sync-analysis-groups.ts b/app/api/job/handler/sync-analysis-groups.ts index c037378..515e91b 100644 --- a/app/api/job/handler/sync-analysis-groups.ts +++ b/app/api/job/handler/sync-analysis-groups.ts @@ -41,7 +41,7 @@ export default async function syncAnalysisGroups() { try { console.info('Getting latest public message id'); - const lastCheckedDate = await getLastCheckedDate(); + // const lastCheckedDate = await getLastCheckedDate(); never used? const latestMessage = await getLatestPublicMessageListItem(); if (!latestMessage) { diff --git a/app/api/job/handler/sync-connected-online.ts b/app/api/job/handler/sync-connected-online.ts index 80e89c9..2255479 100644 --- a/app/api/job/handler/sync-connected-online.ts +++ b/app/api/job/handler/sync-connected-online.ts @@ -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 const isDemoClinic = (clinicId: number) => isProd ? clinicId !== 2 : clinicId === 2; - clinics = responseData.Data.T_Lic.filter(({ ID }) => isDemoClinic(ID)); - services = responseData.Data.T_Service.filter(({ ClinicID }) => + const clinics = responseData.Data.T_Lic.filter(({ ID }) => + isDemoClinic(ID), + ); + const services = responseData.Data.T_Service.filter(({ ClinicID }) => isDemoClinic(ClinicID), ); - serviceProviders = responseData.Data.T_Doctor.filter(({ ClinicID }) => + const serviceProviders = responseData.Data.T_Doctor.filter(({ ClinicID }) => isDemoClinic(ClinicID), ); - jobTitleTranslations = createTranslationMap( + const jobTitleTranslations = createTranslationMap( responseData.Data.P_JobTitleTranslations.filter(({ ClinicID }) => isDemoClinic(ClinicID), ), diff --git a/app/api/job/medipost-retry-dispatch/route.ts b/app/api/job/medipost-retry-dispatch/route.ts index 06a2db6..a191998 100644 --- a/app/api/job/medipost-retry-dispatch/route.ts +++ b/app/api/job/medipost-retry-dispatch/route.ts @@ -21,7 +21,7 @@ export const POST = async (request: NextRequest) => { try { validateApiKey(request); - } catch (e) { + } catch { return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' }); } diff --git a/app/api/job/send-open-jobs-emails/route.ts b/app/api/job/send-open-jobs-emails/route.ts index 9bf4118..0c22957 100644 --- a/app/api/job/send-open-jobs-emails/route.ts +++ b/app/api/job/send-open-jobs-emails/route.ts @@ -14,7 +14,7 @@ export const POST = async (request: NextRequest) => { try { validateApiKey(request); - } catch (e) { + } catch { return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' }); } diff --git a/app/api/job/sync-analysis-groups-store/route.ts b/app/api/job/sync-analysis-groups-store/route.ts index be54509..1def4a9 100644 --- a/app/api/job/sync-analysis-groups-store/route.ts +++ b/app/api/job/sync-analysis-groups-store/route.ts @@ -9,7 +9,7 @@ export const POST = async (request: NextRequest) => { try { validateApiKey(request); - } catch (e) { + } catch { return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' }); } diff --git a/app/api/job/sync-analysis-groups/route.ts b/app/api/job/sync-analysis-groups/route.ts index 83cc6d3..cb06e1c 100644 --- a/app/api/job/sync-analysis-groups/route.ts +++ b/app/api/job/sync-analysis-groups/route.ts @@ -9,7 +9,7 @@ export const POST = async (request: NextRequest) => { try { validateApiKey(request); - } catch (e) { + } catch { return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' }); } diff --git a/app/api/job/sync-analysis-results/route.ts b/app/api/job/sync-analysis-results/route.ts index 392be6a..0f66fbc 100644 --- a/app/api/job/sync-analysis-results/route.ts +++ b/app/api/job/sync-analysis-results/route.ts @@ -9,7 +9,7 @@ export const POST = async (request: NextRequest) => { try { validateApiKey(request); - } catch (e) { + } catch { return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' }); } diff --git a/app/api/job/sync-connected-online/route.ts b/app/api/job/sync-connected-online/route.ts index 065c8ec..41fb295 100644 --- a/app/api/job/sync-connected-online/route.ts +++ b/app/api/job/sync-connected-online/route.ts @@ -9,7 +9,7 @@ export const POST = async (request: NextRequest) => { try { validateApiKey(request); - } catch (e) { + } catch { return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' }); } diff --git a/app/api/job/test-medipost-responses/route.ts b/app/api/job/test-medipost-responses/route.ts index fc1f2e1..0634efd 100644 --- a/app/api/job/test-medipost-responses/route.ts +++ b/app/api/job/test-medipost-responses/route.ts @@ -18,7 +18,7 @@ export async function POST(request: NextRequest) { try { validateApiKey(request); - } catch (e) { + } catch { return NextResponse.json({}, { status: 401, statusText: 'Unauthorized' }); } diff --git a/app/auth/membership-confirmation/layout.tsx b/app/auth/membership-confirmation/layout.tsx index e3d32c7..1360b0f 100644 --- a/app/auth/membership-confirmation/layout.tsx +++ b/app/auth/membership-confirmation/layout.tsx @@ -1,5 +1,3 @@ -import { withI18n } from '~/lib/i18n/with-i18n'; - async function SiteLayout(props: React.PropsWithChildren) { return (
diff --git a/app/auth/update-account/_lib/server/update-account.ts b/app/auth/update-account/_lib/server/update-account.ts index 622787d..2b8b62e 100644 --- a/app/auth/update-account/_lib/server/update-account.ts +++ b/app/auth/update-account/_lib/server/update-account.ts @@ -4,7 +4,6 @@ import { updateCustomer } from '@lib/data/customer'; import { AccountSubmitData, createAuthApi } from '@kit/auth/api'; import { enhanceAction } from '@kit/next/actions'; -import { pathsConfig } from '@kit/shared/config'; import { getSupabaseServerClient } from '@kit/supabase/server-client'; import { UpdateAccountSchemaServer } from '../schemas/update-account.schema'; diff --git a/app/home/(user)/(dashboard)/analysis-results/[id]/page.tsx b/app/home/(user)/(dashboard)/analysis-results/[id]/page.tsx index b18a4da..4962016 100644 --- a/app/home/(user)/(dashboard)/analysis-results/[id]/page.tsx +++ b/app/home/(user)/(dashboard)/analysis-results/[id]/page.tsx @@ -108,7 +108,7 @@ export default async function AnalysisResultsPage({ )}
{orderedAnalysisElements ? ( - orderedAnalysisElements.map((element, index) => ( + orderedAnalysisElements.map((element) => ( {element.results?.nestedElements?.map( diff --git a/app/home/(user)/(dashboard)/cart/montonio-callback/error/page.tsx b/app/home/(user)/(dashboard)/cart/montonio-callback/error/page.tsx index c84908a..dbc57d1 100644 --- a/app/home/(user)/(dashboard)/cart/montonio-callback/error/page.tsx +++ b/app/home/(user)/(dashboard)/cart/montonio-callback/error/page.tsx @@ -1,5 +1,3 @@ -import { use } from 'react'; - import Link from 'next/link'; import { createI18nServerInstance } from '@/lib/i18n/i18n.server'; diff --git a/app/home/(user)/_components/booking/booking.provider.tsx b/app/home/(user)/_components/booking/booking.provider.tsx index 3ae2f1c..8e2b62f 100644 --- a/app/home/(user)/_components/booking/booking.provider.tsx +++ b/app/home/(user)/_components/booking/booking.provider.tsx @@ -51,7 +51,7 @@ export const BookingProvider: React.FC<{ ); setTimeSlots(response.timeSlots); setLocations(response.locations); - } catch (error) { + } catch { setTimeSlots(null); } finally { setIsLoadingTimeSlots(false); diff --git a/app/home/(user)/_components/order-cards.tsx b/app/home/(user)/_components/order-cards.tsx index 0c936ce..4ad6cca 100644 --- a/app/home/(user)/_components/order-cards.tsx +++ b/app/home/(user)/_components/order-cards.tsx @@ -5,7 +5,7 @@ import Link from 'next/link'; import { cn } from '@/lib/utils'; import { pathsConfig } from '@/packages/shared/src/config'; 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 { diff --git a/app/home/(user)/_components/recommendations-skeleton.tsx b/app/home/(user)/_components/recommendations-skeleton.tsx index eaa9917..fad1225 100644 --- a/app/home/(user)/_components/recommendations-skeleton.tsx +++ b/app/home/(user)/_components/recommendations-skeleton.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { InfoTooltip } from '@/packages/shared/src/components/ui/info-tooltip'; -import { HeartPulse } from 'lucide-react'; import { Button } from '@kit/ui/shadcn/button'; import { diff --git a/app/home/(user)/_lib/server/actions.ts b/app/home/(user)/_lib/server/actions.ts index aae04d5..4cacb05 100644 --- a/app/home/(user)/_lib/server/actions.ts +++ b/app/home/(user)/_lib/server/actions.ts @@ -48,7 +48,7 @@ export async function createInitialReservationAction( export async function cancelTtoBooking(bookingCode: string, clinicId: number) { try { - const response = await fetch( + await fetch( `${process.env.CONNECTED_ONLINE_URL}/${ConnectedOnlineMethodName.ConfirmedCancel}`, { headers: { diff --git a/app/home/(user)/_lib/server/is-valid-open-ai-env.ts b/app/home/(user)/_lib/server/is-valid-open-ai-env.ts index 6384a1e..550d8b0 100644 --- a/app/home/(user)/_lib/server/is-valid-open-ai-env.ts +++ b/app/home/(user)/_lib/server/is-valid-open-ai-env.ts @@ -5,7 +5,7 @@ export const isValidOpenAiEnv = async () => { const client = new OpenAI(); await client.models.list(); return true; - } catch (e) { + } catch { return false; } }; diff --git a/app/home/[account]/_components/team-account-navigation-menu.tsx b/app/home/[account]/_components/team-account-navigation-menu.tsx index d0be16d..3df3be8 100644 --- a/app/home/[account]/_components/team-account-navigation-menu.tsx +++ b/app/home/[account]/_components/team-account-navigation-menu.tsx @@ -1,9 +1,6 @@ import { useMemo } from 'react'; -import { - getTeamAccountSidebarConfig, - pathsConfig, -} from '@/packages/shared/src/config'; +import { pathsConfig } from '@/packages/shared/src/config'; import { AppLogo } from '@kit/shared/components/app-logo'; import { ProfileAccountDropdownContainer } from '@kit/shared/components/personal-account-dropdown-container'; @@ -28,25 +25,6 @@ export function TeamAccountNavigationMenu(props: { [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 (
diff --git a/app/home/[account]/_components/team-account-statistics.tsx b/app/home/[account]/_components/team-account-statistics.tsx index d921b5a..800473c 100644 --- a/app/home/[account]/_components/team-account-statistics.tsx +++ b/app/home/[account]/_components/team-account-statistics.tsx @@ -1,6 +1,6 @@ 'use client'; -import { useState } from 'react'; +import { useMemo, useState } from 'react'; import { redirect } from 'next/navigation'; @@ -43,11 +43,13 @@ export default function TeamAccountStatistics({ accountBenefitStatistics, expensesOverview, }: TeamAccountStatisticsProps) { - const currentDate = new Date(); - const [date, setDate] = useState({ - from: new Date(currentDate.getFullYear(), currentDate.getMonth(), 1), - to: new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0), - }); + const date = useMemo(() => { + const currentDate = new Date(); + return { + from: new Date(currentDate.getFullYear(), currentDate.getMonth(), 1), + to: new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0), + }; + }, []); const { i18n: { language }, } = useTranslation(); diff --git a/lib/services/medipost/medipostPrivateMessage.service.ts b/lib/services/medipost/medipostPrivateMessage.service.ts index 12afeee..7a1b99c 100644 --- a/lib/services/medipost/medipostPrivateMessage.service.ts +++ b/lib/services/medipost/medipostPrivateMessage.service.ts @@ -397,7 +397,7 @@ export async function readPrivateMessageResponse({ try { analysisOrder = await getAnalysisOrder({ analysisOrderId }); medusaOrderId = analysisOrder.medusa_order_id; - } catch (e) { + } catch { if (IS_ENABLED_DELETE_PRIVATE_MESSAGE) { await deletePrivateMessage(privateMessageId); } @@ -571,7 +571,6 @@ export async function sendOrderToMedipost({ phone: account.phone ?? '', }, orderId: medreportOrder.id, - orderCreatedAt: new Date(medreportOrder.created_at), comment: '', }); diff --git a/lib/services/medipost/medipostXML.service.ts b/lib/services/medipost/medipostXML.service.ts index b3541bc..974c644 100644 --- a/lib/services/medipost/medipostXML.service.ts +++ b/lib/services/medipost/medipostXML.service.ts @@ -33,7 +33,6 @@ export async function composeOrderXML({ analysisElements, person, orderId, - orderCreatedAt, comment, }: { analyses: AnalysesWithGroupsAndElements; @@ -45,7 +44,6 @@ export async function composeOrderXML({ phone: string; }; orderId: number; - orderCreatedAt: Date; comment?: string; }) { const analysisGroups: Tables<{ schema: 'medreport' }, 'analysis_groups'>[] = diff --git a/packages/email-templates/src/emails/book-time-failed.email.tsx b/packages/email-templates/src/emails/book-time-failed.email.tsx index 7c4cb93..3fd9e48 100644 --- a/packages/email-templates/src/emails/book-time-failed.email.tsx +++ b/packages/email-templates/src/emails/book-time-failed.email.tsx @@ -43,7 +43,7 @@ export async function renderBookTimeFailedEmail({ - Broneeringu {reservationId} Connected Online'i saatmine ei + Broneeringu {reservationId} Connected Online'i saatmine ei õnnestunud, kliendile tuleb teha tagasimakse. Saadud error: {error} diff --git a/packages/email-templates/src/emails/new-jobs-available.email.tsx b/packages/email-templates/src/emails/new-jobs-available.email.tsx index 34fb7d9..7819ecd 100644 --- a/packages/email-templates/src/emails/new-jobs-available.email.tsx +++ b/packages/email-templates/src/emails/new-jobs-available.email.tsx @@ -69,7 +69,7 @@ export async function renderNewJobsAvailableEmail({
    {analysisResponseIds.map((analysisResponseId, index) => ( -
  • +
  • - There was an error loading subscription. - - - Please check the logs for more information or try again later. - - - ); - } - - return ( -
    - Subscription - - - This account does not currently have a subscription. - - } - > - {(subscription) => { - return ( -
    - - - Subscription ID - - Provider - - Customer ID - - Status - - Created At - - Period Starts At - - Ends At - - - - - - {subscription.id} - - - - {subscription.billing_provider} - - - - {subscription.billing_customer_id} - - - - {subscription.status} - - - - {subscription.created_at} - - - - {subscription.period_starts_at} - - - - {subscription.period_ends_at} - - - -
    - - - - Product ID - - Variant ID - - Quantity - - Price - - Interval - - Type - - - - {subscription.subscription_items.map((item) => { - return ( - - - {item.product_id} - - - - {item.variant_id} - - - - {item.quantity} - - - - {item.price_amount} - - - - {item.interval} - - - - {item.type} - - - ); - })} - -
    -
    - ); - }} -
    -
    - ); -} - async function getMemberships(userId: string) { const client = getSupabaseServerClient(); diff --git a/packages/features/auth/src/components/multi-factor-challenge-container.tsx b/packages/features/auth/src/components/multi-factor-challenge-container.tsx index 5ff28d4..b5c9dee 100644 --- a/packages/features/auth/src/components/multi-factor-challenge-container.tsx +++ b/packages/features/auth/src/components/multi-factor-challenge-container.tsx @@ -50,7 +50,7 @@ export function MultiFactorChallengeContainer({ try { await fetch('/api/after-mfa', { method: 'POST' }); router.replace(paths.redirectPath); - } catch (err) { + } catch { // ignore } }, diff --git a/packages/features/team-accounts/src/components/company-guard.tsx b/packages/features/team-accounts/src/components/company-guard.tsx index 5708c66..314d095 100644 --- a/packages/features/team-accounts/src/components/company-guard.tsx +++ b/packages/features/team-accounts/src/components/company-guard.tsx @@ -16,7 +16,7 @@ export function CompanyGuard( Component: LayoutOrPageComponent, ) { return async function AdminGuardServerComponentWrapper(params: Params) { - //@ts-ignore + // @ts-expect-error incorrectly typed params const { account } = await params.params; const client = getSupabaseServerClient(); const [isUserSuperAdmin, isUserCompanyAdmin] = await Promise.all([ diff --git a/packages/features/team-accounts/src/server/actions/team-invitations-server-actions.ts b/packages/features/team-accounts/src/server/actions/team-invitations-server-actions.ts index 8212d9f..d08736b 100644 --- a/packages/features/team-accounts/src/server/actions/team-invitations-server-actions.ts +++ b/packages/features/team-accounts/src/server/actions/team-invitations-server-actions.ts @@ -149,7 +149,6 @@ export const updateInvitationAction = enhanceAction( export const acceptInvitationAction = enhanceAction( async (data: FormData, user) => { const client = getSupabaseServerClient(); - const accountBalanceService = new AccountBalanceService(); const { inviteToken, nextPath } = AcceptInvitationSchema.parse( Object.fromEntries(data), diff --git a/packages/shared/src/components/ui/search.tsx b/packages/shared/src/components/ui/search.tsx index 84dac99..f4f073e 100644 --- a/packages/shared/src/components/ui/search.tsx +++ b/packages/shared/src/components/ui/search.tsx @@ -1,4 +1,4 @@ -import React, { JSX, ReactNode } from 'react'; +import React, { JSX } from 'react'; import { cn } from '@kit/ui/utils';