0.1.0 • Published 4 years ago

@sankei-arc-shared-components/content-source_gallery-by-url v0.1.0

Weekly downloads
34
License
ISC
Repository
github
Last release
4 years ago

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));
  },
};