Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Commit

Permalink
Filter LibCal bookings to requested spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
cappadona committed Aug 13, 2018
1 parent 0fa2045 commit 145a7d6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions utils/libcal.js
Expand Up @@ -54,17 +54,14 @@ const libCal = {
let schedule = {}
bookings
// Only include reservations for requested spaces
.filter(b => _.includes(spaces, b.eid))
.filter(b => _.includes(Object.values(spaces).map(s => s.id), b.eid))
// Add schedule object for each space
.forEach(b => {
console.log('id:', b.eid)
// console.log('include?', _.includes(Object.values(spaces).map(s => s.id), b.eid), '|', Object.values(spaces).map(s => s.id), '|', b.eid)

// Use room name from schema
// let room = Object.entries(spaces).find(s => s[1].id === b.eid)[0]
let room = Object.entries(spaces).find(s => s[1].id === b.eid)

let name = typeof room === 'undefined' ? 'nick' : room[0]
console.log('bueller?', room)
let name = Object.entries(spaces).find(s => s[1].id === b.eid)[0]

schedule[name] = {
id: b.eid,
Expand Down

0 comments on commit 145a7d6

Please sign in to comment.