@fourlights/strapi-plugin-deep-populate 1.4.1 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.mjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ const document = await strapi.documents("api.page.page").findOne({
|
|
|
51
51
|
|
|
52
52
|
```ts
|
|
53
53
|
// Get populate object for custom usage
|
|
54
|
-
const
|
|
54
|
+
const populate = await strapi.plugin("deep-populate")
|
|
55
55
|
.service("populate")
|
|
56
56
|
.get({
|
|
57
57
|
documentId: 'xyz',
|
|
@@ -88,6 +88,7 @@ module.exports = ({ env }) => ({
|
|
|
88
88
|
replaceWildcard: true,
|
|
89
89
|
|
|
90
90
|
contentTypes: {
|
|
91
|
+
// '*' would apply to all content types
|
|
91
92
|
'api::page.page': {
|
|
92
93
|
deny: {
|
|
93
94
|
relations: ['api::page.page'] // prevent resolving nested pages when populating a page
|
package/dist/server/index.js
CHANGED
|
@@ -14617,7 +14617,7 @@ const getHash = (params) => {
|
|
|
14617
14617
|
const cache = ({ strapi: strapi2 }) => ({
|
|
14618
14618
|
async get(params) {
|
|
14619
14619
|
const entry = await strapi2.documents("plugin::deep-populate.cache").findFirst({ filters: { hash: { $eq: getHash(params) } } });
|
|
14620
|
-
return entry ? entry.populate : null;
|
|
14620
|
+
return entry && !isEmpty__default.default(entry.populate) ? entry.populate : null;
|
|
14621
14621
|
},
|
|
14622
14622
|
async set({ populate: populate2, dependencies, ...params }) {
|
|
14623
14623
|
const documentService = strapi2.documents("plugin::deep-populate.cache");
|
|
@@ -14921,7 +14921,7 @@ const populate = ({ strapi: strapi2 }) => ({
|
|
|
14921
14921
|
if (cachedEntry) return cachedEntry;
|
|
14922
14922
|
const resolved = await populate$1(params);
|
|
14923
14923
|
await strapi2.service("plugin::deep-populate.cache").set({ ...params, ...resolved });
|
|
14924
|
-
return resolved;
|
|
14924
|
+
return resolved.populate;
|
|
14925
14925
|
}
|
|
14926
14926
|
});
|
|
14927
14927
|
const services = {
|
package/dist/server/index.mjs
CHANGED
|
@@ -14592,7 +14592,7 @@ const getHash = (params) => {
|
|
|
14592
14592
|
const cache = ({ strapi: strapi2 }) => ({
|
|
14593
14593
|
async get(params) {
|
|
14594
14594
|
const entry = await strapi2.documents("plugin::deep-populate.cache").findFirst({ filters: { hash: { $eq: getHash(params) } } });
|
|
14595
|
-
return entry ? entry.populate : null;
|
|
14595
|
+
return entry && !isEmpty$1(entry.populate) ? entry.populate : null;
|
|
14596
14596
|
},
|
|
14597
14597
|
async set({ populate: populate2, dependencies, ...params }) {
|
|
14598
14598
|
const documentService = strapi2.documents("plugin::deep-populate.cache");
|
|
@@ -14896,7 +14896,7 @@ const populate = ({ strapi: strapi2 }) => ({
|
|
|
14896
14896
|
if (cachedEntry) return cachedEntry;
|
|
14897
14897
|
const resolved = await populate$1(params);
|
|
14898
14898
|
await strapi2.service("plugin::deep-populate.cache").set({ ...params, ...resolved });
|
|
14899
|
-
return resolved;
|
|
14899
|
+
return resolved.populate;
|
|
14900
14900
|
}
|
|
14901
14901
|
});
|
|
14902
14902
|
const services = {
|
package/package.json
CHANGED