From dffa1e211d8155373f08ab06fd9d811741203ed4 Mon Sep 17 00:00:00 2001 From: alnavarrop99 Date: Sun, 7 Apr 2024 22:02:31 -0400 Subject: [PATCH] fix: msw and env config --- src/main.tsx | 2 +- src/pages/_layout/credit.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 } })