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