Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Commit

Permalink
Remove deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
kpostekk committed Mar 27, 2022
1 parent 40743c7 commit 138f6c2
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions src/public-timetable/public-timetable.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,6 @@ export class PublicTimetableService {
return createdTimetable.save()
}

/**
* Updates all occurances in selected date (removeMany + save)
* @param timetable array of schedule entries
* @param date date string
* @deprecated
* @returns
*/
async flushAndSink(timetable: ScheduleEntryDto[], date: DateTime) {
const removed = await this.timetableModel.deleteMany({
'entry.begin': {
$gte: date.toBSON(),
$lte: date.endOf('day').toBSON(),
},
})
this.log.verbose(`Overriding ${removed.deletedCount} results`)

for (const entry of timetable) {
await new this.timetableModel({ entry }).save()
}

return {
result: removed.deletedCount ? 'replaced' : 'added',
}
}

async updateOneEntry(htmlId: string, changeHash: string, entry: ScheduleEntryDto) {
return await this.timetableModel.findOneAndUpdate(
{
Expand Down

0 comments on commit 138f6c2

Please sign in to comment.