@botonic/plugin-flow-builder
Version:
Use Flow Builder to show your contents
19 lines • 774 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getContentsByPayload = void 0;
const tslib_1 = require("tslib");
function getContentsByPayload({ cmsApi, flowBuilderPlugin, request, contentID, }) {
var _a;
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const id = contentID
? (_a = cmsApi.getNodeByContentID(contentID)) === null || _a === void 0 ? void 0 : _a.id
: request.input.payload;
const targetNode = id ? cmsApi.getNodeById(id) : undefined;
if (targetNode) {
return yield flowBuilderPlugin.getContentsByNode(targetNode);
}
return [];
});
}
exports.getContentsByPayload = getContentsByPayload;
//# sourceMappingURL=payload.js.map