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

Changing a request would require changes in 3 places of the code, is there a better solution? #127

Open
Nikola-Milovic opened this issue Sep 2, 2021 · 1 comment

Comments

@Nikola-Milovic
Copy link

Hi, as it stands, if we want to change what parameters our client sends us, eg instead of this

export interface IUserInputDTO {
  name: string;
  email: string;
  password: string;
}

We suddenly need

export interface IUserInputDTO {
  name: string;
  email: string;
  password: string;
birthday: string;
}

We would need to change mongoose schema, celebrate body schema and our interface. Is there a better way about this? Or at least add it so the compiler will complain and give us an auto-complete. Writing this three times without the IDE complaining would be really annoying.

@santiq
Copy link
Owner

santiq commented Sep 2, 2021

Yes I know it sucks,
Several projects has been created to aim to solve it but none convinced me at the time of creating this repo.

You con try with Typegoose maybe ?

https://github.com/typegoose/typegoose

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

No branches or pull requests

2 participants