gid-oss / dataui-nestjs-crud

NestJs CRUD for RESTful APIs
https://github.com/nestjsx/crud/wiki
MIT License
129 stars 31 forks source link

include soft deleted rows #47

Open its-dibo opened 6 months ago

its-dibo commented 6 months ago

I want to include the soft deleted rows for all getOneBase operations, but not getManyBase

CrudConfigService.load({
getOneBase: {
  query:{
      withDeleted: true,
  }
}
})

also, ...

@Override()
getOne(@parsedReq() req: any){
   let options = {  withDeleted: true, }
  return this.base.getOneBase(req, options)
}

creating a new custom method doesn't give the same signature as the inherited getOneBase

@GET()
findOne(@Req() req: any){
 // won't work as expected, and all queries must be implemented manually, such as filter, ...
 // there is no exposed functionality to convert req into parsed req, even `(@ParsedReq() req)` gives undefined
 return this.base.getOneBase(req)
}
zaro commented 6 months ago

@its-dibo Can you try with @Override('getOneBase') instead ?