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 - DTO option for create + update actions #132

Closed
bashleigh opened this issue Jun 27, 2019 · 0 comments · Fixed by #305
Closed

Feature - DTO option for create + update actions #132

bashleigh opened this issue Jun 27, 2019 · 0 comments · Fixed by #305
Assignees

Comments

@bashleigh
Copy link
Collaborator

As discussed. Add a DTO option to the crud decorator to use an optional DTO object instead of the entity.

@Crud({
  model: {
    type: User,
  },
  dto: {
    create: UserCreateDTO,
    update: UserUpdateDTO,
  },
  params: {
    companyId: {
      field: 'companyId',
      type: 'number',
    },
    id: {
      field: 'id',
      type: 'number',
      primary: true,
    },
  },
  query: {
    join: {
      company: {
        exclude: ['description'],
      },
      profile: {
        eager: true,
        exclude: ['updatedAt'],
      },
    },
  },
})
@ApiUseTags('users')
@Controller('/companies/:companyId/users')
export class UserController extends  CrudController<User> {}
@bashleigh bashleigh self-assigned this Jul 20, 2019
michaelyali added a commit that referenced this issue Oct 21, 2019
fix #132

Co-authored-by: bashleigh <ashleighsimonelli@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant