Commit 7b38c349 authored by Odair M.'s avatar Odair M.
Browse files

fix null values on assigment schedules

parent 0218b69b
......@@ -162,6 +162,8 @@ class Schedule{
"log": this.log,
"lat": this.lat
};
if (! obj.assigned )
delete obj.assigned
// Remove undefined props (usefull when transform into YAML)
Object.keys(obj).forEach(key => {
......@@ -185,7 +187,7 @@ class ScheduleCollection{
toJSON(){
return {
"schedules": this.schedules.map(schedule => {return schedule.toJSON()}),
"schedules": this.schedules.map(schedule => { return schedule? schedule.toJSON() : "{}"}),
"id": this.id
}
}
......@@ -384,4 +386,4 @@ module.exports = {Ensalador, EnsaladorPart, Schedule, ScheduleCollection, Room,
// e.execute((err,schedules) => {
// console.log(err,schedules);
// })
\ No newline at end of file
// })
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment