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/4 crud and dtos for event entity #7

Merged
merged 5 commits into from
May 15, 2024

Conversation

LeventeFarkashazi
Copy link
Contributor

Solution for #4

@LeventeFarkashazi LeventeFarkashazi linked an issue May 14, 2024 that may be closed by this pull request
3 tasks
Copy link
Member

@Tschonti Tschonti left a comment

Choose a reason for hiding this comment

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

nice work, but it can be extended a bit. We can merge without the custom validator, that could be a separate task

@@ -16,5 +16,6 @@ module.exports = {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-extra-semi': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'ordered-imports': [true, { 'grouped-imports': false }], //disable anoying empty line between import groups
Copy link
Member

Choose a reason for hiding this comment

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

image
I guess we should use 2 instead of true and maybe 0 instead of false

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rather deleted it because it caused more problems and is not as annoying as I thought before

Comment on lines 15 to 19
@IsDate()
startDate: Date;

@IsDate()
endDate: Date;
Copy link
Member

Choose a reason for hiding this comment

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

we will probably need @IsDateString() here, IsDate expects a Date object, but wie'll get a string

Copy link
Member

Choose a reason for hiding this comment

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

also, it'd be cool to validate that endDate is after startDate. You probably have to create a custom decorator for that, it's a great task if you have the time

}

@Get(':id')
findOne(@Param('id') id: string) {
Copy link
Member

Choose a reason for hiding this comment

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

we should validate the id here. In the course, we used ParseIntPipe, but that's not going to work here since we don't use number based ID.s Instead take a look at ParseUUIDPipe

https://docs.nestjs.com/pipes

Copy link
Member

@Tschonti Tschonti left a comment

Choose a reason for hiding this comment

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

well done, just fix the eslint stuff and then it's good to go. You can comment out the parameters in the service methods

@LeventeFarkashazi LeventeFarkashazi merged commit 9462064 into main May 15, 2024
3 checks passed
@Tschonti Tschonti deleted the feature/4-crud-and-dtos-for-event-entity branch May 15, 2024 21:29
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.

Create basic CRUD endpoints and DTOs for the Event entity
2 participants