Commit f40f3fa7 authored by Paul Kaplan's avatar Paul Kaplan

Rename variables

parent eb3bdfee
const ITEM_LIMIT = 4; const ITEM_LIMIT = 4;
const infoFetcher = studioId => fetch(`${process.env.API_HOST}/studios/${studioId}`) const infoFetcher = studioId => fetch(`${process.env.API_HOST}/studios/${studioId}`)
.then(d => d.json()); .then(response => response.json());
const projectFetcher = (studioId, offset) => const projectFetcher = (studioId, offset) =>
fetch(`${process.env.API_HOST}/studios/${studioId}/projects?limit=${ITEM_LIMIT}&offset=${offset}`) fetch(`${process.env.API_HOST}/studios/${studioId}/projects?limit=${ITEM_LIMIT}&offset=${offset}`)
.then(d => d.json()) .then(response => response.json())
.then(d => ({items: d, moreToLoad: d.length === ITEM_LIMIT})); .then(data => ({items: data, moreToLoad: data.length === ITEM_LIMIT}));
const curatorFetcher = (studioId, offset) => const curatorFetcher = (studioId, offset) =>
fetch(`${process.env.API_HOST}/studios/${studioId}/curators?limit=${ITEM_LIMIT}&offset=${offset}`) fetch(`${process.env.API_HOST}/studios/${studioId}/curators?limit=${ITEM_LIMIT}&offset=${offset}`)
.then(d => d.json()) .then(response => response.json())
.then(d => ({items: d, moreToLoad: d.length === ITEM_LIMIT})); .then(data => ({items: data, moreToLoad: data.length === ITEM_LIMIT}));
const managerFetcher = (studioId, offset) => const managerFetcher = (studioId, offset) =>
fetch(`${process.env.API_HOST}/studios/${studioId}/managers?limit=${ITEM_LIMIT}&offset=${offset}`) fetch(`${process.env.API_HOST}/studios/${studioId}/managers?limit=${ITEM_LIMIT}&offset=${offset}`)
.then(d => d.json()) .then(response => response.json())
.then(d => ({items: d, moreToLoad: d.length === ITEM_LIMIT})); .then(data => ({items: data, moreToLoad: data.length === ITEM_LIMIT}));
const activityFetcher = studioId => const activityFetcher = studioId =>
fetch(`${process.env.API_HOST}/studios/${studioId}/activity`) fetch(`${process.env.API_HOST}/studios/${studioId}/activity`)
.then(d => d.json()) .then(response => response.json())
.then(d => ({items: d, moreToLoad: false})); // No pagination on the activity feed .then(data => ({items: data, moreToLoad: false})); // No pagination on the activity feed
export { export {
activityFetcher, activityFetcher,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment