Conversation
Feat: add generic files(#40013)
Collaborator
|
take latest pull |
mohit-nx
reviewed
Feb 27, 2020
.env
Outdated
| NODE_ENV=dev | ||
| SECRET_KEY = qwertyuiopasdfghjklzxcvbnm123456 | ||
| MONGO_URL=mongodb://localhost:27017/express-training | ||
| password= trainee@123 No newline at end of file |
| in: ['body'], | ||
| errorMessage: 'DOB is required', | ||
| }, | ||
| email: { |
Collaborator
There was a problem hiding this comment.
why have you removed validation for email while creating user?
| }; | ||
| findOne(query): mongoose.Query<D> { | ||
| return this.modelType.findOne(query); | ||
| async findOne(id: string) { |
Collaborator
There was a problem hiding this comment.
cannot find by email like this in version repository. Versioning repository is common to all. cannot update it.
| } | ||
| return await this.modelType.update(_id, deleteddata); | ||
| async delete(id) { | ||
| return await this.modelType.update(id, { deletedAt: new Date() }); |
Collaborator
There was a problem hiding this comment.
it should be {originalId: id}
| ...data, | ||
| updatedAt: new Date() | ||
| }) | ||
| return this.modelType.updateOne(id, { updatedBy: id, deletedBy: id, deletedAt: new Date() }); |
Collaborator
There was a problem hiding this comment.
why doing is when we have already invalidated the object.
mohit-nx
reviewed
Feb 28, 2020
| }); | ||
| public async update(id, data) { | ||
| let record = await this.findOne(id); | ||
| this.delete(id); |
Collaborator
There was a problem hiding this comment.
need to make operations syncronous
src/libs/seedData.ts
Outdated
| console.log("::::::::::", Password) | ||
| return await bcrypt.hash(Password, 10) | ||
| } | ||
| const ecncryptPassword = await encodedPassword(config.Password) |
Collaborator
There was a problem hiding this comment.
encodedPAssword is a helper and used at mutliple place. Define it as a helper function instead of defining at every location.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.