diff --git a/src/main.tsx b/src/main.tsx index 5728c3c..b12c330 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -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'); diff --git a/src/pages/_layout/credit.tsx b/src/pages/_layout/credit.tsx index e907087..5c25eb4 100644 --- a/src/pages/_layout/credit.tsx +++ b/src/pages/_layout/credit.tsx @@ -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>( async ({ id: creditId, owner_id, frecuencia_del_credito_id }) => { const { nombres, apellidos } = await getClientById({ params: { clientId: "" + owner_id } })