Skip to content

[Backend] Create Course Module#14

Open
amanyih wants to merge 1 commit intobackendfrom
courses
Open

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

Conversation

@amanyih
Copy link
Copy Markdown
Collaborator

@amanyih amanyih commented Feb 15, 2023

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

Copy link
Copy Markdown
Contributor

@Merwan-J Merwan-J left a comment

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