@botonic/plugin-contentful
Version:
Botonic Plugin Contentful is one of the **[available](https://github.com/hubtype/botonic/tree/master/packages)** plugins for Botonic. **[Contentful](http://www.contentful.com)** is a CMS (Content Management System) which manages contents of a great variet
23 lines • 931 B
JavaScript
import { __awaiter } from "tslib";
import * as cms from '../../cms';
import { addCustomFields, ContentfulEntryUtils, } from '../delivery-utils';
import { DeliveryWithReference } from './reference';
export class PayloadDelivery extends DeliveryWithReference {
constructor(delivery, resumeErrors) {
super(cms.ContentType.PAYLOAD, delivery, resumeErrors);
}
payload(id, context) {
return __awaiter(this, void 0, void 0, function* () {
const entry = yield this.getEntry(id, context);
return this.fromEntry(entry, context);
});
}
fromEntry(entry, context) {
const referenceDelivery = {
delivery: this.reference,
context,
};
return addCustomFields(new cms.Payload(ContentfulEntryUtils.commonFieldsFromEntry(entry), entry.fields.payload || ''), entry.fields, referenceDelivery);
}
}
//# sourceMappingURL=payload.js.map