how to put the full object workstation
in another object userWorkstationSchedule
?
code:
Workstation.js
module.exports = {
tableName: 'workstation',
attributes: {
name: { type: 'string', required: true, maxLength: 100, columnType: 'VARCHAR(100)' },
company: { model: 'company', required: true },
workDates: { collection: 'workstationSchedule', via: 'workstation'},
reservedDates: {collection: 'userWorkstationSchedule', via: 'workstation'},
}
}
reservedDates
attribute receives data from the userWorkstationSchedule
object
UserWorkstationSchedule.js
module.exports = {
tableName: 'user_workstation_schedule',
attributes: {
presenceSchedules: { collection: 'presenceschedule', via: 'userWorkstationSchedule' },
workstation: {collection: 'workstation', via: 'reservedDates'},
}
}