Skip to content

Commit

Permalink
Merge branch 'master' into fix/update_githubPr_variable_name
Browse files Browse the repository at this point in the history
  • Loading branch information
valerydluski committed Sep 16, 2024
2 parents 793465d + d86e658 commit 31656d3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions nestjs/src/courses/courses.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ import { CourseMentorsController, CourseMentorsService } from './course-mentors'
import { CourseStudentsController } from './course-students/course-students.controller';
import { CourseStudentsService } from './course-students/course-students.service';
import { MentorReviewsController, MentorReviewsService } from './mentor-reviews';
import { ConfigModule } from '../config';

@Module({
imports: [
Expand Down Expand Up @@ -100,6 +101,7 @@ import { MentorReviewsController, MentorReviewsService } from './mentor-reviews'
UsersModule,
UsersNotificationsModule,
CloudApiModule,
ConfigModule,
],
controllers: [
FeedbacksController,
Expand Down
5 changes: 4 additions & 1 deletion nestjs/src/courses/courses.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ export class CoursesService {
relations: ['discipline'],
});

const data: ExportCourseDto[] = courses.map(course => new ExportCourseDto(course));
const data: ExportCourseDto[] = courses
.filter(course => course.alias !== 'test-course')
.filter(course => !course.inviteOnly)
.map(course => new ExportCourseDto(course));

if (this.configService.env === 'prod') {
this.s3.putObject({
Expand Down
7 changes: 6 additions & 1 deletion nestjs/src/courses/dto/export-course.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@ export class ExportCourseDto {
constructor(course: Course) {
this.id = course.id;
this.name = course.name;
this.fullName = course.fullName;
this.startDate = course.startDate.toISOString();
this.endDate = course.endDate.toISOString();
this.alias = course.alias;
this.discipline = course.discipline;
this.discipline = course.discipline ? { id: course.discipline.id, name: course.discipline.name } : null;
this.description = course.description;
this.descriptionUrl = course.descriptionUrl;
this.registrationEndDate = course.registrationEndDate.toISOString();
}

id: number;
name: string;
fullName: string;
alias: string;
description: string;
descriptionUrl: string;
discipline: { id: number; name: string } | null;
registrationEndDate: string;
startDate: string;
Expand Down

0 comments on commit 31656d3

Please sign in to comment.