“Error ‘Something Went Wrong’ When Selecting Any Value from Category Dropdown in Dashboard > Monthly Expense Card” #503

Closed
kartik.sharma wants to merge 1 commits from Kartik_Bug#1666 into Issues_Expense_2W

View File

@ -35,7 +35,7 @@ const ExpenseByProject = () => {
const getSelectedTypeName = () => { const getSelectedTypeName = () => {
if (!selectedType) return "All Types"; if (!selectedType) return "All Types";
const found = ExpenseTypes.find((t) => t.id === selectedType); const found = ExpenseCategories.find((t) => t.id === selectedType);
return found ? found.name : "All Types"; return found ? found.name : "All Types";
}; };
@ -69,8 +69,8 @@ const ExpenseByProject = () => {
const ExpenseCategoryType = [ const ExpenseCategoryType = [
{id:1,category:"Category",label:"Category"}, { id: 1, category: "Category", label: "Category" },
{id:2,category:"Project",label:"Project"} { id: 2, category: "Project", label: "Project" }
] ]
return ( return (
@ -91,19 +91,19 @@ const ExpenseByProject = () => {
> >
{viewMode} {viewMode}
</button> </button>
<ul className="dropdown-menu dropdown-menu-end "> <ul className="dropdown-menu dropdown-menu-end ">
{ExpenseCategoryType.map((cat)=>( {ExpenseCategoryType.map((cat) => (
<li> <li>
<button <button
className="dropdown-item" className="dropdown-item"
onClick={() => { onClick={() => {
setViewMode(cat.category); setViewMode(cat.category);
setSelectedType(""); setSelectedType("");
}} }}
> >
{cat.label} {cat.label}
</button> </button>
</li> </li>
))} ))}
</ul> </ul>
</div> </div>
@ -115,8 +115,8 @@ const ExpenseByProject = () => {
<button <button
key={item} key={item}
className={`border-0 px-2 py-1 text-sm rounded ${range === item className={`border-0 px-2 py-1 text-sm rounded ${range === item
? "text-white bg-primary" ? "text-white bg-primary"
: "text-body bg-transparent" : "text-body bg-transparent"
}`} }`}
style={{ cursor: "pointer", transition: "all 0.2s ease" }} style={{ cursor: "pointer", transition: "all 0.2s ease" }}
onClick={() => setRange(item)} onClick={() => setRange(item)}