diff --git a/src/pages/master/wallet/blocks/Types.ts b/src/pages/master/wallet/Types.ts similarity index 85% rename from src/pages/master/wallet/blocks/Types.ts rename to src/pages/master/wallet/Types.ts index 58db1ed..ac4b94f 100644 --- a/src/pages/master/wallet/blocks/Types.ts +++ b/src/pages/master/wallet/Types.ts @@ -1,6 +1,22 @@ import React from 'react'; import { toast } from 'sonner'; +export interface WalletProps { + id: string; + name: string; + description: string; + id_currency: string; + status: string; + group: WalletGroupProps[]; +} + +export interface WalletGroupProps { + id: string; + name: string; + description: string; + status: string; +} + export interface CurrencyProps { ID: string; code: string; diff --git a/src/pages/master/wallet/blocks/AddDialog.tsx b/src/pages/master/wallet/blocks/AddDialog.tsx index 99341d0..a753b93 100644 --- a/src/pages/master/wallet/blocks/AddDialog.tsx +++ b/src/pages/master/wallet/blocks/AddDialog.tsx @@ -24,7 +24,7 @@ import { Button } from '@/components/ui/button'; import { Checkbox } from '@/components/ui/checkbox'; import { doSaveLogActivity } from '@/actions/GlobalActions'; import { RefreshCw } from 'lucide-react'; -import { CurrencyProps, GroupProps, initialStateWallet, validateFormsWallet } from './Types'; +import { CurrencyProps, GroupProps, initialStateWallet, validateFormsWallet } from '../Types'; const API_URL_WALLET = apiConfig.service_wallet; const API_URL_MASTER_DATA = apiConfig.service_master_data; diff --git a/src/pages/master/wallet/blocks/EditDialog.tsx b/src/pages/master/wallet/blocks/EditDialog.tsx index f7190b6..6ba3033 100644 --- a/src/pages/master/wallet/blocks/EditDialog.tsx +++ b/src/pages/master/wallet/blocks/EditDialog.tsx @@ -23,7 +23,7 @@ import { import { Button } from '@/components/ui/button'; import { doSaveLogActivity } from '@/actions/GlobalActions'; import { RefreshCw } from 'lucide-react'; -import { CurrencyProps, GroupProps, initialStateWallet, validateFormsWallet } from './Types'; +import { CurrencyProps, GroupProps, initialStateWallet, validateFormsWallet } from '../Types'; const API_URL_WALLET = apiConfig.service_wallet; const API_URL_MASTER_DATA = apiConfig.service_master_data; diff --git a/src/pages/master/wallet/hooks/ManageWalletContext.tsx b/src/pages/master/wallet/hooks/ManageWalletContext.tsx index 15e8469..3bee0ba 100644 --- a/src/pages/master/wallet/hooks/ManageWalletContext.tsx +++ b/src/pages/master/wallet/hooks/ManageWalletContext.tsx @@ -5,15 +5,7 @@ import { ColumnDef } from '@tanstack/react-table'; import React, { createContext, useCallback, useMemo, useState } from 'react'; import { Toaster } from 'sonner'; import ListToolbar from '../blocks/ListToolbar'; - -interface WalletProps { - id: string; - name: string; - status: string; - description: string; - group: string[]; - currency_id: string; -} +import { WalletProps } from '../Types'; interface ContextProps { wallet: WalletProps[]; @@ -146,7 +138,10 @@ const ManageWalletContextProvider = ({ children }: { children: React.ReactNode } const getWalletLists = async (page: number, limit: number, sorting: any, filter: any) => { try { sorting = sorting.length == 0 ? [{ id: 'name', desc: false }] : sorting; - filter = filter.length == 0 ? {} : { 'wallets.name': { like: `%${filter[0].value?.toLowerCase()}%` } }; + filter = + filter.length == 0 + ? {} + : { 'wallets.name': { like: `%${filter[0].value?.toLowerCase()}%` } }; const response = await GetData(`${API_URL_MASTER_DATA}/wallet/list`, { limit,