Skip to content

Commit

Permalink
Fix: organization_slots not iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
georgipavlov-7DIGIT committed Sep 26, 2024
1 parent 0086c6a commit b612e9c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion service/utils/helperFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,11 @@ export const getEarliestAvailableSlot = async (
// Find the earliest upcoming availability slot that is not already in the upcoming consultations
for (let j = 0; j < upcomingAvailability.length; j++) {
let availability = upcomingAvailability[j];
const organizationSlots = availability.organization_slots || [];
const availabilityToMap = (
campaignId
? availability.campaign_slots
: [...availability.slots, ...availability.organization_slots]
: [...availability.slots, ...organizationSlots]
).sort((a, b) => {
// sort by time asc
if (a.time && b.time) {
Expand Down

0 comments on commit b612e9c

Please sign in to comment.