From ff15af483ee9f1dd7d49ee1038d736b519f7204f Mon Sep 17 00:00:00 2001 From: Dilmurod Date: Tue, 13 May 2025 18:10:42 +0500 Subject: [PATCH] change base url and websocket , bug fixes update,accounting history page --- src/API/api.ts | 6 +- src/App.tsx | 4 +- .../Accounting/AccountingHistory.tsx | 147 +++++++++--------- src/Components/Updates/UpdateEdit.tsx | 4 +- src/Components/Updates/UpdateTable.tsx | 4 +- 5 files changed, 82 insertions(+), 83 deletions(-) diff --git a/src/API/api.ts b/src/API/api.ts index 67ba70d..ee00204 100644 --- a/src/API/api.ts +++ b/src/API/api.ts @@ -4,9 +4,9 @@ import axios from "axios"; // baseURL: "http://10.10.10.64:8080/api/v1/", // }); const instance = axios.create({ - // baseURL: "https://board-api.ontime-logs.com/api/v1/", - baseURL: "https://api.tteld.co/api/v1/", - // baseURL: "http://10.10.10.64:8000/api/v1/", + baseURL: "https://board-api.ontime-logs.com/api/v1/", + // baseURL: "https://api.tteld.co/api/v1/", + // baseURL: "http://10.10.10.29:8000/api/v1/", }); const token: string | null = localStorage.getItem("access"); diff --git a/src/App.tsx b/src/App.tsx index 38873b2..2b68966 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -286,8 +286,8 @@ const App: React.FC = () => { // ); // taskSocket = new WebSocket(`wss://api.tteld.co/global/?user_id=${admin_id}`); taskSocket = new WebSocket( - // `wss://board-socket.ontime-logs.com/global/?user_id=${admin_id}` - `wss://ontime-socket.tteld.co/global/?user_id=${admin_id}` + `wss://board-api.ontime-logs.com/global/?user_id=${admin_id}` + // `wss://ontime-socket.tteld.co/global/?user_id=${admin_id}` // `ws://10.10.10.64:8000/global/?user_id=${admin_id}` ); diff --git a/src/Components/Accounting/AccountingHistory.tsx b/src/Components/Accounting/AccountingHistory.tsx index 4fc6dfb..0ce5eb6 100644 --- a/src/Components/Accounting/AccountingHistory.tsx +++ b/src/Components/Accounting/AccountingHistory.tsx @@ -467,81 +467,80 @@ const AccountingHistory: React.FC = () => { {years.length === 0 ? ( ) : ( - years.map((year) => ( -
- {year} - {userData && - userData.salaries - .filter((salary) => salary.year === year) - .map((filteredSalary) => ( - , - dataIndex: "no", - width: "5%", - align: "center", - render: (text, record, index) => index + 1, - }, - { title: "Year", dataIndex: "year" }, - { title: "Month", dataIndex: "month" }, + years.map((year) => { + const salariesForYear = + userData?.salaries?.filter((salary) => salary.year === year) || + []; - { - title: "Total Charges", - dataIndex: "total_charges", - render: (text: string, record: any) => ( - ${record.total_charges} - ), - }, - { - title: "Total Bonus", - dataIndex: "total_bonuses", - render: (text: string, record: any) => ( - ${record.total_bonuses} - ), - }, - { - title: "Total Salary", - dataIndex: "total_salary", - render: (text: string, record: any) => ( - ${record.total_salary} - ), - }, - { - title: "Action", - dataIndex: "salary_document_path", - align: "center", - render: (text, record) => ( - -
, + dataIndex: "no", + width: "5%", + align: "center", + render: (text, record, index) => index + 1, + }, + { title: "Year", dataIndex: "year" }, + { title: "Month", dataIndex: "month" }, + { + title: "Total Charges", + dataIndex: "total_charges", + render: (text: string, record: any) => ( + ${record.total_charges} + ), + }, + { + title: "Total Bonus", + dataIndex: "total_bonuses", + render: (text: string, record: any) => ( + ${record.total_bonuses} + ), + }, + { + title: "Total Salary", + dataIndex: "total_salary", + render: (text: string, record: any) => ( + ${record.total_salary} + ), + }, + { + title: "Action", + dataIndex: "salary_document_path", + align: "center", + render: (text, record) => ( + +