Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: generate daily events fixed #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

fix: generate daily events fixed #27

wants to merge 2 commits into from

Conversation

PriyamAgrawal
Copy link
Collaborator

No description provided.

})

return returnArr
}
var date = req.query.date
var filename = path.join(__dirname, `events-${date}.pdf`)
console.log(date)
var eventsRef = admin.database().ref('to-be-held/' + date)
var eventRef = admin.database().ref()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eventRef is a misleading variable name in this case. Something like firebaseDB would be more appropriate.

eventsRef.once('value', function (snapshot) {
// if(snapshot.val()===null) {
// console.log("No events Booked for this day")
// }
var html
var eventID = snapshotToArray(snapshot)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could check the length of the array and respond if it is 0 here itself instead of using the counter i.

eventObj.push(snapshot.val().clubName)
eventObj.push(roomlist)
eventarr.push(eventObj)
}
i++
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try not to use the counter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants