Skip to content

Commit 283ea6a

Browse files
authored
Merge pull request #450 from CodingFactory-Repos/fix/lint_errors
[Fix] - Lint errors
2 parents 9dd52fc + a2a557b commit 283ea6a

50 files changed

Lines changed: 440 additions & 426 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

back-end/src/app.controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ export class AppController {
4545
],
4646
}),
4747
)
48-
// @ts-ignore
49-
file: any,
48+
file: // @ts-ignore
49+
any,
5050
@Param('context') context: string,
5151
@Res() res: Response,
5252
) {

back-end/src/base/articles/interfaces/articles.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface Article {
1515
type: number;
1616
participants?: Array<User>;
1717
eventDate?: Date;
18-
status: string,
18+
status: string;
1919
}
2020

2121
export interface Commentary {

back-end/src/base/calls/calls.repository.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,6 @@ export class CallsRepository {
547547
return course.groups;
548548
}
549549

550-
551550
async saveMessage(userId: ObjectId, courseId: string, message: any) {
552551
const courseObjectId = new ObjectId(courseId);
553552
const userObjectId = new ObjectId(userId);
@@ -621,7 +620,7 @@ export class CallsRepository {
621620
}
622621
const groups = course.groups;
623622
let groupToJoin = null;
624-
const groupIdToJoin = new ObjectId(groupId['groupId'])
623+
const groupIdToJoin = new ObjectId(groupId['groupId']);
625624
groups.map((group) => {
626625
if (new ObjectId(group.id).equals(groupIdToJoin)) {
627626
groupToJoin = group;
@@ -852,7 +851,6 @@ export class CallsRepository {
852851

853852
const actualCourse = await this.db.collection('courses').findOne(query);
854853

855-
856854
// La base n'est pas typée, j'ai besoin de tout en front donc voilà
857855
return actualCourse ?? null;
858856
}

back-end/src/base/calls/calls.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class CallsService {
4646
async getActualCourse(userId: ObjectId) {
4747
return await this.callsRepository.getActualCourse(userId);
4848
}
49-
49+
5050
async getActualCourseGroup(userId: ObjectId) {
5151
const actualCourse = await this.callsRepository.getActualCourseGroup(userId);
5252
return actualCourse;
Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
import {
2-
Controller,
3-
Get,
4-
Post,
5-
Res,
6-
Req,
7-
UseFilters,
8-
UseGuards,
9-
Param,
10-
} from '@nestjs/common';
1+
import { Controller, Get, Post, Res, Req, UseFilters, UseGuards, Param } from '@nestjs/common';
112
import { Response, Request } from 'express';
123
import { ServiceErrorCatcher } from 'src/common/decorators/catch.decorator';
134
import { CoursesService } from 'src/base/courses/courses.service';
@@ -29,16 +20,15 @@ export class CoursesController {
2920
@Get('/allCourses')
3021
async getAllCourses(@Res() res: Response) {
3122
const courses = await this.coursesService.getAllCourses();
32-
return res.status(200).json({ status: 'ok', courses })
23+
return res.status(200).json({ status: 'ok', courses });
3324
}
3425

3526
@Get('/:id')
36-
async getCoursesById(@Req() req: Request, @Res() res: Response, @Param('id') courseId: string){
37-
const courseById = await this.coursesService.getCoursesById(courseId)
27+
async getCoursesById(@Req() req: Request, @Res() res: Response, @Param('id') courseId: string) {
28+
const courseById = await this.coursesService.getCoursesById(courseId);
3829
return res.status(200).json({ status: 'ok', courseById });
3930
}
4031

41-
4232
@Post('/create')
4333
async createCourse(@Req() req: Request, @Res() res: Response) {
4434
await this.coursesService.createCourse(req.body).then((course) => {
@@ -50,8 +40,4 @@ export class CoursesController {
5040
const courses = await this.coursesService.getAllCourses();
5141
return res.status(200).json(courses);
5242
}
53-
5443
}
55-
56-
57-

back-end/src/base/courses/courses.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { RetrospectivesRepository } from '../retrospectives/retrospectives.repos
1717
CoursesRepository,
1818
UsersRepository,
1919
CanvasRoomRepository,
20-
RetrospectivesRepository
20+
RetrospectivesRepository,
2121
],
2222
controllers: [CoursesController],
2323
exports: [CoursesService, CoursesRepository],

back-end/src/base/courses/courses.service.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class CoursesService {
1212
@Inject(forwardRef(() => CanvasRoomRepository))
1313
private coursesRepository: CoursesRepository,
1414
private retrospectiveRepository: RetrospectivesRepository,
15-
private canvasRoomRepository: CanvasRoomRepository
15+
private canvasRoomRepository: CanvasRoomRepository,
1616
) {}
1717

1818
// Business logic methods goes there...
@@ -23,15 +23,17 @@ export class CoursesService {
2323
}
2424

2525
async getCoursesById(courseId: string) {
26-
const courses = await this.coursesRepository.findOne({_id: new ObjectId(courseId)});
27-
const retro = await this.retrospectiveRepository.findOne({_id: new ObjectId(courses.retro)})
28-
const canvas = await this.canvasRoomRepository.findManyCanvasRoom({_id: {$in: courses.projects}})
26+
const courses = await this.coursesRepository.findOne({ _id: new ObjectId(courseId) });
27+
const retro = await this.retrospectiveRepository.findOne({ _id: new ObjectId(courses.retro) });
28+
const canvas = await this.canvasRoomRepository.findManyCanvasRoom({
29+
_id: { $in: courses.projects },
30+
});
2931

3032
return {
3133
course: courses,
3234
retro: retro,
33-
projects: canvas
34-
}
35+
projects: canvas,
36+
};
3537
}
3638

3739
async createCourse(query) {

back-end/src/base/courses/dto/coures.dto.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
21
import { User } from '@/base/users/interfaces/users.interface';
3-
import {
4-
IsNotEmpty,
5-
IsOptional,
6-
IsString,
7-
} from 'class-validator';
2+
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
83

94
export class CourseDTO {
105
@IsOptional()
@@ -40,5 +35,5 @@ export class CourseDTO {
4035
project?: Array<any>; // Don't know what it is
4136

4237
@IsOptional()
43-
site?: string
38+
site?: string;
4439
}

back-end/src/base/courses/interfaces/courses.interface.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,23 @@ export interface Course {
77
tag: string;
88
classId?: ObjectId;
99
picture: string;
10-
language: string;
11-
createdAt: Date;
12-
periodStart: Date;
13-
periodEnd: Date;
14-
presence:[];
10+
language: string;
11+
createdAt: Date;
12+
periodStart: Date;
13+
periodEnd: Date;
14+
presence: [];
1515
projects: Array<ObjectId>;
16-
site: string;
17-
teacherId?: ObjectId;
16+
site: string;
17+
teacherId?: ObjectId;
1818
isLocked?: boolean;
19-
groups?: Array<Group>
20-
retro: ObjectId
21-
trellos?: Array<any> // WAITING FOR TRELLO
19+
groups?: Array<Group>;
20+
retro: ObjectId;
21+
trellos?: Array<any>; // WAITING FOR TRELLO
2222
/*
2323
productOwner?: User;
2424
academicYear?: AcademicYear;
2525
retrospective?: Retrospective;
2626
*/
27-
2827
}
2928

3029
export interface Call {

back-end/src/base/groups/groups.controller.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@ export class GroupsController {
2626

2727
return res.status(200).json({ status: 'ok' });
2828
}
29-
3029
}

0 commit comments

Comments
 (0)