|
|
@ -92,13 +92,13 @@ const streamFns = {
|
|
|
|
return await streams.find().populate('event').populate({
|
|
|
|
return await streams.find().populate('event').populate({
|
|
|
|
path: 'matches',
|
|
|
|
path: 'matches',
|
|
|
|
populate: [{ path: 'orange' }, { path: 'blue' }],
|
|
|
|
populate: [{ path: 'orange' }, { path: 'blue' }],
|
|
|
|
}).populate('casters').populate('hosts').exec()
|
|
|
|
}).populate('casters').populate('hosts').lean().exec()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
getById: async (id) => {
|
|
|
|
getById: async (id) => {
|
|
|
|
return await streams.findById(id).populate('event').populate({
|
|
|
|
return await streams.findById(id).populate('event').populate({
|
|
|
|
path: 'matches',
|
|
|
|
path: 'matches',
|
|
|
|
populate: [{ path: 'orange' }, { path: 'blue' }],
|
|
|
|
populate: [{ path: 'orange' }, { path: 'blue' }],
|
|
|
|
}).populate('casters').populate('hosts').exec()
|
|
|
|
}).populate('casters').populate('hosts').lean().exec()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
update: async(id, data) => {
|
|
|
|
update: async(id, data) => {
|
|
|
|
return await streams.findByIdAndUpdate(id, data).exec()
|
|
|
|
return await streams.findByIdAndUpdate(id, data).exec()
|
|
|
|