fixed: show color data when deleting a lesson

This commit is contained in:
Sergey Yarkov 2021-11-29 23:03:58 +03:00
parent 426a3283f6
commit 56493f97b4

View File

@ -149,7 +149,7 @@ export default class LessonRepository {
* @returns Deleted lesson or null
*/
public async delete(id: string | number): Promise<Lesson | null> {
const lesson = await this.Lesson.query().where('id', id).first();
const lesson = await this.Lesson.query().where('id', id).preload('color').first();
if (lesson) {
await lesson.delete();