diff --git a/src/Components/Accounting/AccountingCurrent.tsx b/src/Components/Accounting/AccountingCurrent.tsx index ddaff5c..c73081a 100644 --- a/src/Components/Accounting/AccountingCurrent.tsx +++ b/src/Components/Accounting/AccountingCurrent.tsx @@ -66,9 +66,9 @@ const AccountingCurrent: React.FC = () => { const currentInfo = new Date().toLocaleString("default", { month: "long" }); const [page, setPage] = useState(1); - const [pageSize, setPageSize] = useState(10); + const [pageSize, setPageSize] = useState(15); - const pageSizeOptions = [10, 20, 30, 40, 50]; + const pageSizeOptions = [15, 20, 30, 40, 50]; const handlePageSizeChange = (value: number) => { setPageSize(value); diff --git a/src/Components/Accounting/AccountingHistory.tsx b/src/Components/Accounting/AccountingHistory.tsx index 273c190..bf99cc0 100644 --- a/src/Components/Accounting/AccountingHistory.tsx +++ b/src/Components/Accounting/AccountingHistory.tsx @@ -55,7 +55,7 @@ interface SalaryData { const AccountingHistory: React.FC = () => { const [page, setPage] = useState(1); - const [pageSize, setPageSize] = useState(10); + const [pageSize, setPageSize] = useState(15); const [open, setOpen] = useState(false); const [userData, setUserData] = useState(null); @@ -81,7 +81,7 @@ const AccountingHistory: React.FC = () => { const [loading, setLoading] = useState(false); - const pageSizeOptions = [10, 20, 30, 40, 50]; + const pageSizeOptions = [15, 20, 30, 40, 50]; const handlePageSizeChange = (value: number) => { setPageSize(value); diff --git a/src/Components/Accounting/AccountingLast.tsx b/src/Components/Accounting/AccountingLast.tsx index 8378b9b..e52ef09 100644 --- a/src/Components/Accounting/AccountingLast.tsx +++ b/src/Components/Accounting/AccountingLast.tsx @@ -91,9 +91,9 @@ const AccountingCurrent: React.FC = () => { }; const [page, setPage] = useState(1); - const [pageSize, setPageSize] = useState(10); + const [pageSize, setPageSize] = useState(15); - const pageSizeOptions = [10, 20, 30, 40, 50]; + const pageSizeOptions = [15, 20, 30, 40, 50]; const handlePageSizeChange = (value: number) => { setPageSize(value); diff --git a/src/Components/Accounting/ConfirmedMonths.tsx b/src/Components/Accounting/ConfirmedMonths.tsx index cc9aca6..87156a1 100644 --- a/src/Components/Accounting/ConfirmedMonths.tsx +++ b/src/Components/Accounting/ConfirmedMonths.tsx @@ -7,9 +7,9 @@ import { LeftOutlined, RightOutlined } from "@ant-design/icons"; function ConfirmedMonths() { const [page, setPage] = useState(1); - const [pageSize, setPageSize] = useState(10); + const [pageSize, setPageSize] = useState(15); - const pageSizeOptions = [10, 20, 30, 40, 50]; + const pageSizeOptions = [15, 20, 30, 40, 50]; const handlePageSizeChange = (value: number) => { setPageSize(value); diff --git a/src/Components/CallRequests/Call.tsx b/src/Components/CallRequests/Call.tsx index 9817c68..a15bab8 100644 --- a/src/Components/CallRequests/Call.tsx +++ b/src/Components/CallRequests/Call.tsx @@ -18,7 +18,7 @@ import { theme } from "antd"; const Call = ({ socketData }: { socketData: TSocket | undefined }) => { const [status, setStatus] = useState("Awaiting"); const [page, setPage] = useState(1); - const [pageSize, setPageSize] = useState(10); + const [pageSize, setPageSize] = useState(15); const [tableData, setTableData] = useState(); const { data, isLoading, refetch } = useCallData({ @@ -27,7 +27,7 @@ const Call = ({ socketData }: { socketData: TSocket | undefined }) => { page_size: pageSize, }); - const pageSizeOptions = [10, 20, 30, 40, 50]; + const pageSizeOptions = [15, 20, 30, 40, 50]; const handlePageSizeChange = (value: number) => { setPageSize(value); diff --git a/src/Components/Companies/Companies.tsx b/src/Components/Companies/Companies.tsx index e7a88d3..15ebabc 100644 --- a/src/Components/Companies/Companies.tsx +++ b/src/Components/Companies/Companies.tsx @@ -23,7 +23,7 @@ const Company = () => { const [search, setSearch] = useState(); const [page, setPage] = useState(1); - const [pageSize, setPageSize] = useState(10); + const [pageSize, setPageSize] = useState(15); const { data, isLoading, refetch } = useCompanyPaginated({ name: search, is_active: undefined, @@ -31,7 +31,7 @@ const Company = () => { page_size: pageSize, }); - const pageSizeOptions = [10, 20, 30, 40, 50]; + const pageSizeOptions = [15, 20, 30, 40, 50]; const handlePageSizeChange = (value: number) => { setPageSize(value); diff --git a/src/Components/Companies/CompaniesEdit.tsx b/src/Components/Companies/CompaniesEdit.tsx index e1becb8..9a487c1 100644 --- a/src/Components/Companies/CompaniesEdit.tsx +++ b/src/Components/Companies/CompaniesEdit.tsx @@ -359,7 +359,7 @@ const CompanyEdit = () => { bottom: 0, left: 0, width: "100%", - // backgroundColor: token.colorBgContainer, + backgroundColor: token.colorBgContainer, boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)", padding: "10px 0", zIndex: 1000, diff --git a/src/Components/Customers/Customers.tsx b/src/Components/Customers/Customers.tsx index 29bacbf..48fc481 100644 --- a/src/Components/Customers/Customers.tsx +++ b/src/Components/Customers/Customers.tsx @@ -20,7 +20,7 @@ import { theme } from "antd"; const Customer = () => { const [open, setOpen] = useState(false); const [page, setPage] = useState(1); - const [pageSize, setPageSize] = useState(10); + const [pageSize, setPageSize] = useState(15); const showModal = () => { setOpen(true); }; @@ -35,7 +35,7 @@ const Customer = () => { page: page, }); - const pageSizeOptions = [10, 20, 30, 40, 50]; + const pageSizeOptions = [15, 20, 30, 40, 50]; const handlePageSizeChange = (value: number) => { setPageSize(value); diff --git a/src/Components/Requests/Requests.tsx b/src/Components/Requests/Requests.tsx index 883b7e4..3f55820 100644 --- a/src/Components/Requests/Requests.tsx +++ b/src/Components/Requests/Requests.tsx @@ -30,9 +30,9 @@ const Requests = ({ socketData }: { socketData: TSocket | undefined }) => { const [requestData, setRequestData] = useState(); const [status, setStatus] = useState("Pending"); const [page, setPage] = useState(1); - const [pageSize, setPageSize] = useState(10); + const [pageSize, setPageSize] = useState(15); - const pageSizeOptions = [10, 20, 30, 40, 50]; + const pageSizeOptions = [15, 20, 30, 40, 50]; const handlePageSizeChange = (value: number) => { setPageSize(value); diff --git a/src/Components/Services/Services.tsx b/src/Components/Services/Services.tsx index 590a00b..a6080bb 100644 --- a/src/Components/Services/Services.tsx +++ b/src/Components/Services/Services.tsx @@ -11,9 +11,9 @@ import { theme } from "antd"; const Service = () => { const [page, setPage] = useState(1); - const [pageSize, setPageSize] = useState(10); + const [pageSize, setPageSize] = useState(15); - const pageSizeOptions = [10, 20, 30, 40, 50]; + const pageSizeOptions = [15, 20, 30, 40, 50]; const handlePageSizeChange = (value: number) => { setPageSize(value); diff --git a/src/Components/Statistics/Statistic.tsx b/src/Components/Statistics/Statistic.tsx index e6df3d2..4dbff43 100644 --- a/src/Components/Statistics/Statistic.tsx +++ b/src/Components/Statistics/Statistic.tsx @@ -82,11 +82,11 @@ const Stat = () => { const [startDate, setStartDate] = useState(start_date); const [endDate, setEndDate] = useState(end_date); const [page, setPage] = useState(1); - const [pageSize, setPageSize] = useState(10); + const [pageSize, setPageSize] = useState(15); const [forSalary, setForSalary] = useState(true); - const pageSizeOptions = [10, 20, 30, 40, 50]; + const pageSizeOptions = [15, 20, 30, 40, 50]; const handlePageSizeChange = (value: number) => { setPageSize(value); diff --git a/src/Components/Tasks/AddTask.tsx b/src/Components/Tasks/AddTask.tsx index fe06c6b..f3a01db 100644 --- a/src/Components/Tasks/AddTask.tsx +++ b/src/Components/Tasks/AddTask.tsx @@ -81,14 +81,39 @@ const AddTask = ({ // console.log(customerData.data); // team select + // useEffect(() => { + // if (companyId) { + // const selectedCompany = companyData?.find( + // (item) => item.id === companyId + // ); + // form.setFieldsValue({ + // assigned_to_id: selectedCompany?.team?.id, + // }); + // customerController + // .customerByCompany( + // { + // name: customerName, + // page: 1, + // page_size: 5, + // }, + // companyId + // ) + // .then((data) => { + // setCustomerData(data.data); + // }); + // } + // }, [companyId, customerName]); + useEffect(() => { - if (companyId) { - const selectedCompany = companyData?.find( - (item) => item.id === companyId - ); - form.setFieldsValue({ - assigned_to_id: selectedCompany?.team?.id || undefined, - }); + if (companyId && companyData?.length) { + const selectedCompany = companyData.find((item) => item.id === companyId); + + if (selectedCompany?.team?.id) { + form.setFieldsValue({ + assigned_to_id: selectedCompany.team.id, + }); + } + customerController .customerByCompany( { @@ -100,9 +125,13 @@ const AddTask = ({ ) .then((data) => { setCustomerData(data.data); + }) + .catch((error) => { + console.error("Customer fetch error:", error); + setCustomerData([]); }); } - }, [companyId, customerName]); + }, [companyId, customerName, companyData]); // service select const serviceOptions = ServiceData?.data?.map((item: any) => ({ @@ -158,7 +187,9 @@ const AddTask = ({ ]; form.setFieldsValue(updatedValues); }) - .catch((error) => {}); + .catch((error) => { + console.log(error); + }); } } } @@ -331,7 +362,7 @@ const AddTask = ({ ]} >