Skip to content

Commit

Permalink
Rename getPhysicalQueuedReservations to getQueuedReservations
Browse files Browse the repository at this point in the history
This is also used for mapped reservations from Publizon
  • Loading branch information
kasperbirch1 committed Nov 3, 2023
1 parent cba6c57 commit 8e15e3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/core/utils/helpers/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export const pageSizeGlobal = (
export const materialIsOverdue = (date: string | undefined | null) =>
dayjs().isAfter(dayjs(date), "day");

export const getPhysicalQueuedReservations = (list: ReservationType[]) => {
export const getQueuedReservations = (list: ReservationType[]) => {
return [...list].filter(
({ state }) => state === dashboardReservedApiValueText
);
Expand Down
8 changes: 3 additions & 5 deletions src/core/utils/useReservations.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useGetReservationsV2 } from "../fbs/fbs";
import { useGetV1UserReservations } from "../publizon/publizon";
import { getPhysicalQueuedReservations } from "./helpers/general";
import { getQueuedReservations } from "./helpers/general";
import {
mapFBSReservationToReservationType,
mapPublizonReservationToReservationType
Expand Down Expand Up @@ -36,10 +36,8 @@ const useReservations = () => {
];

// Combine "still in queue" reservations from both FBS and Publizon
const queuedFBSReservations = getPhysicalQueuedReservations(
mappedReservationsFbs
);
const queuedPublizonReservations = getPhysicalQueuedReservations(
const queuedFBSReservations = getQueuedReservations(mappedReservationsFbs);
const queuedPublizonReservations = getQueuedReservations(
mappedReservationsPublizon
);
const allQueuedReservations = [
Expand Down

0 comments on commit 8e15e3d

Please sign in to comment.