-
Notifications
You must be signed in to change notification settings - Fork 17
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
base: master
Are you sure you want to change the base?
Conversation
controllers/eventController.js
Outdated
}) | ||
|
||
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() |
There was a problem hiding this comment.
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.
controllers/eventController.js
Outdated
eventsRef.once('value', function (snapshot) { | ||
// if(snapshot.val()===null) { | ||
// console.log("No events Booked for this day") | ||
// } | ||
var html | ||
var eventID = snapshotToArray(snapshot) |
There was a problem hiding this comment.
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
.
controllers/eventController.js
Outdated
eventObj.push(snapshot.val().clubName) | ||
eventObj.push(roomlist) | ||
eventarr.push(eventObj) | ||
} | ||
i++ |
There was a problem hiding this comment.
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.
No description provided.