Skip to content

Commit

Permalink
Merge pull request #155 from CA-G12/154-fix-bugs
Browse files Browse the repository at this point in the history
154 fix bugs
  • Loading branch information
tareq-abuaqlain authored Nov 10, 2022
2 parents 0f28a47 + 45cee12 commit eb13ef2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 14 deletions.
46 changes: 35 additions & 11 deletions client/src/components/userDashboard/userBills.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,45 @@ const UserBills: React.FC = () => {

) : (
<>
<Title>الفواتير</Title>
<div className="topContainer">
<Title>الفواتير</Title>
<div>
<Select
defaultValue="جميع الشقق"
style={{ width: 120 }}
onChange={handleChange}
options={
getIds().map((ele :any) => ({
lable: ele,
value: ele,
}))
}
/>
<Select
defaultValue="مدفوع / غير مدفوع"
style={{ width: 120 }}
onChange={handleChange}
options={[
{
value: 'all',
label: 'مدفوع / غير مدفوع',
},
{
value: 'false',
label: 'مدفوع',
},
{
value: 'true',
label: 'غير مدفوع',
},
]}
/>
</div>
</div>
<NoData />
</>
)
)
);
};
export default UserBills;

// {
// (loading) ? <Loading /> : ((userBill.length > 0) ? (
// <Table
// pagination={{ defaultPageSize: 5 }}
// columns={columns}
// dataSource={userBill}
// />
// ) : <NoData />)
// }
6 changes: 3 additions & 3 deletions server/controllers/billUser/getUsersBills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export default async (req:InferRequestPayload, res:Response, next:NextFunction)
attributes: [],

});
if (is_open) {
data = data.filter((x) => x['Flats.Bills.is_open'].toString() === is_open);
}
if (data[0]['Flats.Bills.id'] === null) {
data = [];
}
if (is_open) {
data = data.filter((x) => x['Flats.Bills.is_open'].toString() === is_open);
}
console.log('data: ', data);
if (data) {
res.json({ data });
Expand Down

0 comments on commit eb13ef2

Please sign in to comment.