Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] - Add list of students #185

Merged
merged 4 commits into from
Mar 23, 2023

Conversation

AyakorK
Copy link
Contributor

@AyakorK AyakorK commented Mar 23, 2023

This feature has been made to print the list of students of a same class in the scan zone

@AyakorK AyakorK requested review from RuKaSuu and Maghwyn March 23, 2023 17:14
@AyakorK AyakorK requested a review from Loule95450 as a code owner March 23, 2023 17:14
@github-advanced-security
Copy link

You have successfully added a new SonarCloud configuration ``. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.

@UseGuards(JwtAuthGuard)
async studentList(@Param() courseId: CourseIdObject, @Res() res: Response) {
const studentIdList = await this.callsService.getStudentList(courseId);
const studentList = await Promise.all(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using Promise.all(...)
You can do : collection.find( { _id: { $in: [ObjectId("id"),...,...] } }).toArray()

@@ -11,7 +11,7 @@ export class CallsService {
constructor(
@Inject(forwardRef(() => UsersRepository))
@Inject(forwardRef(() => CallsRepository))
private usersRepository: UsersRepository,
public usersRepository: UsersRepository,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.

this.message = '';
} else {
this.message = "Vous n'avez pas de cours aujourd'hui";
}
},

getStudentList() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use -> getStudentList: withErrorHandler(async function() {
...
})

If the call return an error, your page crash.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Maghwyn Maghwyn merged commit cf0bed0 into develop-G10 Mar 23, 2023
@AyakorK AyakorK deleted the G10/feature/add_list_of_students branch March 23, 2023 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants