@paroicms/content-loading-plugin 0.7.0 → 0.8.0
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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeSearch = makeSearch;
|
|
4
4
|
exports.getPartials = getPartials;
|
|
5
|
-
exports.
|
|
5
|
+
exports.toNodeId = toNodeId;
|
|
6
6
|
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
7
7
|
const public_anywhere_lib_1 = require("@paroicms/public-anywhere-lib");
|
|
8
8
|
async function makeSearch(service, query, req, res) {
|
|
@@ -22,8 +22,8 @@ async function makeSearch(service, query, req, res) {
|
|
|
22
22
|
}
|
|
23
23
|
async function getPartials(service, req, res, params, labeledById) {
|
|
24
24
|
const documentId = params["children-of"];
|
|
25
|
-
const parentId = (0, public_anywhere_lib_1.
|
|
26
|
-
const labeledByTermId = (0, data_formatters_lib_1.isDef)(labeledById) ?
|
|
25
|
+
const parentId = (0, public_anywhere_lib_1.parseNodelId)(documentId);
|
|
26
|
+
const labeledByTermId = (0, data_formatters_lib_1.isDef)(labeledById) ? toNodeId(labeledById) : undefined;
|
|
27
27
|
const payload = {
|
|
28
28
|
templateName: params.templateName,
|
|
29
29
|
documentId: documentId,
|
|
@@ -38,8 +38,6 @@ async function getPartials(service, req, res, params, labeledById) {
|
|
|
38
38
|
labeledByTermId,
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return
|
|
43
|
-
? (0, public_anywhere_lib_1.parseSectionId)(leafOrSectionId).leafId
|
|
44
|
-
: leafOrSectionId;
|
|
41
|
+
function toNodeId(nodeOrNodelId) {
|
|
42
|
+
return nodeOrNodelId.indexOf(":") !== -1 ? (0, public_anywhere_lib_1.parseNodelId)(nodeOrNodelId).nodeId : nodeOrNodelId;
|
|
45
43
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paroicms/content-loading-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Content loading plugin for ParoiCMS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"paroicms",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"@paroicms/public-server-lib": "0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@paroicms/public-anywhere-lib": "0.
|
|
36
|
-
"@paroicms/public-server-lib": "0.
|
|
35
|
+
"@paroicms/public-anywhere-lib": "0.12.0",
|
|
36
|
+
"@paroicms/public-server-lib": "0.20.0",
|
|
37
37
|
"@solid-primitives/i18n": "~2.1.1",
|
|
38
38
|
"@solidjs/router": "~0.14.1",
|
|
39
39
|
"@types/node": "~20.14.8",
|