nestjsx / crud

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

How to list soft deleted data when using crud generator #804

Open abhishek-p-au16 opened 2 years ago

abhishek-p-au16 commented 2 years ago

Select soft deleted record when using left joint

How to list soft deleted data when using crud generator

ag7-alexis commented 1 year ago

Hi, did you find a solution ?

ag7-alexis commented 1 year ago

@abhishek-p-au16

 protected setJoin(cond: QueryJoin, joinOptions: JoinOptions, builder: SelectQueryBuilder<PartnershipRequestEntity>): boolean {
    builder.withDeleted().andWhere({ deleted: IsNull() });
    super.setJoin(cond, joinOptions, builder);
    return true;
  }

You can try this, withDeleted remove all deleted is null, and then I add a where deleted is null on ma main entity. I'm not sure if this is the correct function to override but that works