Skip to content

[Backend] Create Course Module#14

Open
amanyih wants to merge 1 commit into
backendfrom
courses
Open

[Backend] Create Course Module#14
amanyih wants to merge 1 commit into
backendfrom
courses

Conversation

@amanyih

@amanyih amanyih commented Feb 15, 2023

Copy link
Copy Markdown
Collaborator

Created Courses Module.
-Didn't handle custom error message.
-used my own connection string

@amanyih amanyih requested a review from Merwan-J February 15, 2023 12:32
@@ -0,0 +1,4 @@
export class CreateCourseDto {
name: string;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

validate dto

import { CreateCourseDto } from './create-courseDto.dto';
import { OmitType } from '@nestjs/swagger';

export class UpdateCourseDto extends OmitType(CreateCourseDto, [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

checkout the documentation for omitType

} catch (err) {
throw err;
}
if (!courses) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should compare length

course = await this.courseModel.findById(id);
} catch (err) {
console.log(err);
throw err.reason;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

error handling not consistent

@Merwan-J Merwan-J left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

update your code

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