message: feat: changed thumbUrl (course) return to get URL with image path
diff: @@ -23,10 +23,10 @@ export class Course extends Audit {
  description: string;
  @Column({
  + name: 'thumbUrl',
  nullable: true,
  })
  - @Expose()
  - thumbUrl: string;
  + thumbUrlFromDatabase: string;
  @Column({
  type: 'varchar',
  @@ -41,6 +41,24 @@ export class Course extends Audit {
  @OneToMany<Lesson>(() => Lesson, (lesson: Lesson) => lesson.course)
  lessons: Lesson[];
  +
  + @Expose()
  + get thumbUrl(): string {
  + if (this.thumbUrlFromDatabase && /^http(s?):\/\//.test(this.thumbUrlFromDatabase)) {
  + return this.thumbUrlFromDatabase;
  + }
  + const fileName = this.photoName || this.thumbUrlFromDatabase;
  + if (fileName) {
  + return 'https://newschoolbrapi-dev.herokuapp.com/api/v1/upload/' + fileName;
  + }
  + return null;
  + }
  +
  + // eslint-disable-next-line @typescript-eslint/no-empty-function
  + set thumbUrl(thumbUrl: string) {
  + this.thumbUrlFromDatabase = thumbUrl;
  + }
  +
  @Column()
  @Expose()
  get slug(): string {
  