Refactor_Expenses #317

Closed
pramod.mahajan wants to merge 247 commits from Refactor_Expenses into Feature_Expense
2 changed files with 12 additions and 3 deletions
Showing only changes of commit 2fa3aa0025 - Show all commits

View File

@ -202,7 +202,7 @@ const canDetetExpense = (expense)=>{
</div>
)}
<div className="card">
<div className="card px-0 px-sm-4">
<div
className="card-datatable table-responsive "
id="horizontal-example"

View File

@ -3,8 +3,10 @@ import ExpenseRepository from "../repositories/ExpsenseRepository";
import showToast from "../services/toastService";
import { queryClient } from "../layouts/AuthLayout";
import { useSelector } from "react-redux";
import moment from "moment";
// -------------------Query------------------------------------------------------
const cleanFilter = (filter) => {
const cleaned = { ...filter };
@ -14,12 +16,19 @@ const cleanFilter = (filter) => {
}
});
if (!cleaned.startDate) delete cleaned.startDate;
if (!cleaned.endDate) delete cleaned.endDate;
// moment.utc() to get consistent UTC ISO strings
if (!cleaned.startDate) {
cleaned.startDate = moment.utc().subtract(7, "days").startOf("day").toISOString();
}
if (!cleaned.endDate) {
cleaned.endDate = moment.utc().startOf("day").toISOString();
}
return cleaned;
};
export const useExpenseList = (
pageSize,
pageNumber,