Skip to content

Commit

Permalink
fixed filling of billing informations
Browse files Browse the repository at this point in the history
  • Loading branch information
Doniaab committed Dec 14, 2023
1 parent ffad47d commit 43c2a77
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/components/Psychologist/Reimbursement/Bill.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const Bill = () => {
const { month, year } = useParams();
const [user, setUser] = useState({});
const [appointments, setAppointments] = useState([]);
const [billInfos, setBillInfos] = useState([]);
const [universityInfos, setUniversityInfos] = useState({ name: undefined, address: undefined });

useEffect(() => {
Expand Down Expand Up @@ -56,7 +57,8 @@ const Bill = () => {
if (Object.keys(appointments).length > 0 && Object.keys(user).length > 0) {
window.print();
}
}, [appointments, user]);
setBillInfos(getInfos());
}, [appointments, user, billInfos]);

const filteredDate = Object.keys(appointments).filter(date => {
const appointmentDate = utcDate(date);
Expand Down Expand Up @@ -109,7 +111,7 @@ const Bill = () => {
</HeaderBody>
</DSHeader>
<div className={styles.content}>
{getInfos().map(info => (
{billInfos.map(info => (
<div className={styles.info}>
{info}
</div>
Expand Down

0 comments on commit 43c2a77

Please sign in to comment.