From 56493f97b494e7d7891dfd048fd5d8cbffe68d2d Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Mon, 29 Nov 2021 23:03:58 +0300 Subject: [PATCH] fixed: show color data when deleting a lesson --- app/Repositories/LessonRepository.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Repositories/LessonRepository.ts b/app/Repositories/LessonRepository.ts index 437144e..abd7ab5 100644 --- a/app/Repositories/LessonRepository.ts +++ b/app/Repositories/LessonRepository.ts @@ -149,7 +149,7 @@ export default class LessonRepository { * @returns Deleted lesson or null */ public async delete(id: string | number): Promise { - 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();