79449452

Date: 2025-02-18 20:04:16
Score: 1.5
Natty:
Report link

The correct answer is that I need to add params with type: "string" ID, it actually had value type: "number"

@Crud({
  model: {
      type: User
    }, 
    params: {
      UserID: {
        field: 'UserID',
        type: 'string',
        primary: true
      }
    }
})
@ApiTags('users')
@Controller('users')
export class UserController implements CrudController<User> {
  
  constructor(public service: UserService) {

  }

  get base(): CrudController<User> {
    return this;
  }
}

Original answer found here: https://github.com/nestjsx/crud/issues/240#issuecomment-527350394

Reasons:
  • Blacklisted phrase (0.5): I need
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: dguard