@sankei-arc-shared-components/content-source_gallery-by-url
v0.1.0
Published
Content Source that returns a gallery from the content API using a url
Downloads
96
Readme
Content Gallery By URL: A Sankei Shared Fusion Component
How to make calls to Content API:
Gallery Call General Conetent API
How do I use it in my Fusion Project?
/**
* Makes a call to the url
* https://{CONTENT_BASE}/content/v4/galleries/?website_url={website}&website={arc-site}&included_fields={includedFields}
*
* @param website_url String: the website url (if null uses default)
* */
import { createContentSource } from '@sankei-arc-shared-components/content-source_gallery-by-url';
import addResizedUrls from '../transforms/image-resizer';
import orderGalleryByStarredImage from '../transforms/gallery-order-by-starred-image';
import includedFields from './common/included-fields/gallery';
import filter from '../filters/gallery';
const { params, resolve } = createContentSource({
includedFields,
});
export default {
resolve,
params,
filter,
transform(data) {
return addResizedUrls(orderGalleryByStarredImage(data));
},
};