fix import and type of wallet
This commit is contained in:
@ -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;
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user