This commit is contained in:
2022-08-04 08:39:11 +07:00
parent 4fb1723b76
commit ab94607e81
5 changed files with 198 additions and 15 deletions

View File

@@ -6,7 +6,7 @@ import AddIcon from '@mui/icons-material/Add';
import UploadIcon from '@mui/icons-material/Upload';
import CancelIcon from '@mui/icons-material/Cancel';
// hooks
import React, { Component, useEffect, useRef, useState } from 'react';
import React, { ChangeEvent, Component, useEffect, useRef, useState } from 'react';
import useSettings from '../../../hooks/useSettings';
import { Link, useNavigate, useParams, useSearchParams } from 'react-router-dom';
// components
@@ -143,7 +143,7 @@ export default function PlanList() {
total: 0
});
const loadDataTableData = async (appliedFilter = null) => {
const loadDataTableData = async (appliedFilter : any | null = null) => {
setDataTableLoading(true);
const filter = appliedFilter ? appliedFilter : Object.fromEntries([...searchParams.entries()]);
const response = await axios.get('/corporates/'+corporate_id+'/divisions', { params: filter });
@@ -157,7 +157,7 @@ export default function PlanList() {
fontWeight: 'bold',
};
const applyFilter = async (searchFilter) => {
const applyFilter = async (searchFilter: any) => {
await loadDataTableData({ "search" : searchFilter });
setSearchParams({ "search" : searchFilter });
}