Skip to content

Commit

Permalink
Ensure that materials ready for loan display the correct "Lån før XX-…
Browse files Browse the repository at this point in the history
…XX-XXXX" date.

I am not a big fan of the `fetchDigitalMaterial` and `fetchMaterial` higher-order components. They are too difficult to read. Maybe these should be rewritten in the future. However, from what I can see, there is never an `identifier` in the props. Therefore, the `isDigital` variable is never set to true. This causes `getInfo` inside `src/apps/reservation-list/reservation-material/reservation-info.tsx` to use `pickupDeadline` instead of `expiryDate`, which is the intended behavior for digital materials.
  • Loading branch information
kasperbirch1 committed Mar 4, 2025
1 parent 21bf972 commit 0a714bc
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export interface ReservationMaterialProps {
reservation: ReservationType;
focused: boolean;
openReservationDetailsModal: (reservation: ReservationType) => void;
identifier?: string | null;
dataCy?: string;
}

Expand All @@ -21,13 +20,12 @@ const ReservationMaterial: FC<ReservationMaterialProps & MaterialProps> = ({
reservation,
focused,
openReservationDetailsModal,
identifier,
dataCy = "reservation-material"
}) => {
const openDetailsModal = () => {
openReservationDetailsModal(reservation);
};
const isDigital = !!identifier;
const isDigital = !!material?.externalProductId;

return (
<li>
Expand Down

0 comments on commit 0a714bc

Please sign in to comment.