This repository was archived by the owner on Sep 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
fix(dto): Fix DTO validation #21
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TheoDurr
approved these changes
Nov 9, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
status: pending discussion
The issue or pull request needs more discussion before it can be closed or merged
type: enhancement
Improvement of an existing feature, which can potentially change its operation
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal here is to remove usage of zod to use NestJS DTO validation
Changed
src/_mixintosrc/baseas it makes more sense.ImagesServiceis now a child ofFilesServiceAdded
ApiNotOkResponsethat easily merge all 400 responses into 1 decorator (instead of 4)ApiUploadFilethat merge 3 decorators into 1ApiDownloadFilewhich is a disguisedApiOkResponsewith the data content modified toapplication/octet-streamto match NestJS Streamable file system.ApiForbiddenResponseandApiUnauthorizedResponsetoGuardPermissionsdecorators as they always comes togetheri18nForbiddenException,i18nBadRequestException,i18nNotFoundExceptionandi18nUnauthorizedExceptionwhich enhance base NestJS https exceptions to add i18n support to it.class-validatorsdecorators to pre-translate & adapt validations steps for our needs (such asi18nIsEmail()which verify for blacklisted hosts/emails) (this also prevent boilerplate in some cases).Removed
TranslateServiceremoved as it was only used for errors/success messages which are now directly translated usingi18n...exceptions.FilesService.WriteOnDiskAsImage()asImagesServicenow inherits fromFilesServiceand super theFilesService.WriteOnDisk()method.Fixed
user.verifiedinstead ofuser.email_verifiedinAuthService.validateUser()