Skip to content

Commit

Permalink
Merge pull request #15 from alnavarrop99/deploy/credit
Browse files Browse the repository at this point in the history
Fix ts errors to deploy
  • Loading branch information
alnavarrop99 authored Apr 8, 2024
2 parents a0f75ef + dffa1e2 commit 63d3776
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/components/ui/calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ function Calendar({
...classNames,
}}
components={{
IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4" />,
IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4" />,
IconLeft: (props) => <ChevronLeft {...props} className="h-4 w-4" />,
IconRight: (props) => <ChevronRight {...props} className="h-4 w-4" />,
}}
{...props}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { createBrowserHistory, createRouter, RouterProvider } from '@tanstack/re
import { routeTree } from './routeTree.gen'

async function enableMocking() {
if (!+import.meta.env.VITE_MSW){
if (!+import.meta.env.VITE_MSW || !import.meta.env.DEV){
return;
}
const { worker } = await import('@/mocks/config');
Expand Down
26 changes: 12 additions & 14 deletions src/pages/_layout/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,7 @@ export function Clients({
column.toggleVisibility(!!value)
}
>
{
text.dropdown.items?.[
getMenuItem(column.id as TMenuItems)
]
}
{getMenuItem(column.id)}
</DropdownMenuCheckboxItem>
))}
</DropdownMenuContent>
Expand Down Expand Up @@ -352,6 +348,7 @@ export function Clients({

Clients.displayname = 'ClientsList'

/* eslint-disable-next-line */
type TMenuItems =
| 'numero_de_identificacion'
| 'telefono'
Expand All @@ -360,17 +357,18 @@ type TMenuItems =
| 'fullName'
| 'apellidos'
| 'referencia'
const getMenuItem = (name: TMenuItems) => {

const getMenuItem = (name: string) => {
const data = {
numero_de_identificacion: 'id' as keyof TClientTable,
telefono: 'telephone' as keyof TClientTable,
celular: 'phone' as keyof TClientTable,
direccion: 'direction' as keyof TClientTable,
fullName: 'firstName' as keyof TClientTable,
apellidos: 'lastName' as keyof TClientTable,
referencia: 'ref' as keyof TClientTable,
numero_de_identificacion: text.dropdown.items?.id,
telefono: text.dropdown.items?.telephone,
celular: text.dropdown.items?.phone,
direccion: text.dropdown.items?.direction,
fullName: text.dropdown.items?.firstName,
apellidos: text.dropdown.items?.lastName,
referencia: text.dropdown.items?.ref,
}
return data?.[name] ?? 'fullName'
return data?.[name as TMenuItems] ?? 'fullName'
}

const text = {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/_layout/client/$clientId/update.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Separator } from '@/components/ui/separator'
import { toast } from '@/components/ui/use-toast'
import { DialogDescription } from '@radix-ui/react-dialog'
import { Navigate, createFileRoute } from '@tanstack/react-router'
import { useContext, useEffect, useMemo, useRef, useState } from 'react'
import { useContext, useMemo, useRef, useState } from 'react'
import clsx from 'clsx'
import { ToastAction } from '@radix-ui/react-toast'
import { Switch } from '@/components/ui/switch'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/_layout/credit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const Route = createFileRoute('/_layout/credit')({
component: Credits,
loader: async () => {
// TODO: this is a temporal function to getFilter
if(+import.meta.env.VITE_MSW) return (await getCreditsFilter()());
if(!!+import.meta.env.VITE_MSW && import.meta.env.DEV) return (await getCreditsFilter()());
const list = await getCreditsList()
const data: TCREDIT_GET_FILTER_ALL = await Promise.all( list?.map<Promise<TCREDIT_GET_FILTER>>( async ({ id: creditId, owner_id, frecuencia_del_credito_id }) => {
const { nombres, apellidos } = await getClientById({ params: { clientId: "" + owner_id } })
Expand Down
2 changes: 1 addition & 1 deletion src/pages/_layout/credit_/$creditId_/update.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { TPAYMENT_GET, TPAYMENT_GET_BASE } from '@/api/payment'
import { listFrecuencys } from '@/lib/type/frecuency'
import { TCLIENT_GET_BASE, getClientsList } from '@/api/clients'
import { getUsersList } from '@/api/users'
import { X as Close, Cross } from 'lucide-react'
import { Cross } from 'lucide-react'

export const Route = createFileRoute('/_layout/credit/$creditId/update')({
component: UpdateCreditById,
Expand Down

0 comments on commit 63d3776

Please sign in to comment.