@sankei-arc-shared-components/content-source_story-feed-by-search
v3.0.4
Published
Content Source that returns a story feed from the content API using different search parameters
Downloads
93
Readme
Content Source Story Feed By Search: A Sankei Shared Fusion Component
How to make calls to Content API:
How do I use it in my Fusion Project?
/**
* Makes a call to the url
* https://{CONTENT_BASE}/content/v4/search/published?website=${website}&size=${size}&from=${offset}&body=${encodedBody}&_sourceInclude=${includedFields}&sort=display_date:desc
*
* @param website_url String: the website url (if null uses default)
* */
import { createContentSource } from '@sankei-arc-shared-components/content-source_story-feed-by-search';
import addResizedUrls from '../transforms/image-resizer';
const schemaName = 'ans-feed';
const queryStringFunction = () => 'q=type:story+AND+credits.by._id:user';
const { params, resolve } = createContentSource({
defaultSite: 'my-site',
defaultFeedOffset: 0,
defaultFeedSize: 10,
queryStringFunction,
includedFields,
sort: 'display_date:desc',
});
export default {
resolve,
schemaName,
params,
transform(data) {
return addResizedUrls(data);
},
};