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> {}
As discussed. Add a DTO option to the crud decorator to use an optional DTO object instead of the entity.