Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Import/export for types with populated components #93

Merged
merged 17 commits into from
Oct 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions server/config/type.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ const ConfigType = class ConfigType {
});

await Promise.all(relations.map(async (relation) => {
await strapi.entityService.delete(this.queryString, relation.id);
await strapi.query(queryString).delete({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, this indeed seems to fix the integration tests.
What do you reckon was the fix?

To me, looking at it, I think prior to this commit you used the wrong query string.
You changed this.queryString to queryString. I believe that was the fix.
Meaning you should still be able to get away with a entityService.delete instead of reverting back to using the strapi.query layer.

where: { id: relation.id },
});
}));
}));

Expand Down Expand Up @@ -117,7 +119,7 @@ const ConfigType = class ConfigType {
data: query,
});
} catch (error) {
strapi.log.warn(logMessage(`Use Query Engine API instead of Entity Service API for type ${this.configPrefix}`));
console.warn(logMessage(`Use Query Engine API instead of Entity Service API for type ${this.configPrefix}`));
await queryAPI.update({ where: combinedUidWhereFilter, data: query });
}

Expand Down
Loading