Commit 38357795 authored by Rafael S Castilho's avatar Rafael S Castilho
Browse files

Merge branch 'fix_null' into 'development'

fix null values on assigment schedules

See merge request !6
parents 0218b69b 7b38c349
......@@ -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