-
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
Required System information
- Node.js version:
- NPM version:
- Strapi version:
- Database:
- Operating system:
- Is your project Javascript or Typescript:
Describe the bug
I run the following query
query Suppliers($filters: SupplierFiltersInput, $certificationsFilters2: CertificationFiltersInput) {
suppliers(filters: $filters) {
data {
id
attributes {
companyName
recipient_organization {
data {
id
attributes {
name
certifications(filters: $certificationsFilters2) {
data {
id
}
}
}
}
}
}
}
}
}
some of the Suppliers have a recipient_organization that have a few deleted certifications
And they appear in the results. Unfortunately.
I guess because
const sdWrapParams = async (defaultService: any, opts: any, ctx: { uid: string, action: string }) => {
const { uid, action } = ctx;
const wrappedParams = await defaultService.wrapParams(opts, ctx);
if (!plugin.supportsContentType(uid)) {
return wrappedParams;
}
// Prevent users to set values for _softDeletedAt, _softDeletedById, and _softDeletedByType
if (wrappedParams.data) {
delete wrappedParams.data._softDeletedAt;
delete wrappedParams.data._softDeletedById;
delete wrappedParams.data._softDeletedByType;
}
return {
...wrappedParams,
filters: {
$and: [
{
...wrappedParams.filters
},
{
_softDeletedAt: {
$null: true
},
},
],
},
};
}
the following filter
_softDeletedAt: {
$null: true
},
apply only for top level entity.
Steps to reproduce the behavior
- Create two or more entities
- add relations between they
- add records to both of the table
- remove some of nested records
- Make request with related nested records.
You will see deleted records in the result
Expected behavior
I think would be good to get only non-deleted records.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working