Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/fetch-landings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const { getLandingLinks } = require('./http-utils');

const queryPages = /* GraphQL */ `
query($conferenceTitle: ConferenceTitle, $eventYear: EventYear) {
conf: conferenceBrand(where: { title: $conferenceTitle }) {
id
year: conferenceEvents(where: { year: $eventYear }) {
id
emsEventId
}
}
}
`;

const fetchData = async (client, vars) => {
const data = await client.request(queryPages, vars).then(res => {
return res.conf.year[0].emsEventId;
});

const landingLinks = (await getLandingLinks(data)) || [];

return {
landingLinks,
};
};

module.exports = {
fetchData,
queryPages,
getData: res => res,
story: 'landingLinks',
};
2 changes: 2 additions & 0 deletions src/http-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const getMcs = baseEventFetch('users?role=MC');
const getCommittee = baseEventFetch('users?role=PC');
const getFreeWorkshops = baseEventFetch('free-workshops');
const getEvent = baseEventFetch('');
const getLandingLinks = baseEventFetch('latestLinks');

module.exports = {
getSpeakers,
Expand All @@ -40,4 +41,5 @@ module.exports = {
getCommittee,
getEvent,
getFreeWorkshops,
getLandingLinks,
};
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const extContent = require('./fetch-extended');
const jobsContent = require('./fetch-jobs');
const committeeContent = require('./fetch-committee');
const diversityContent = require('./fetch-diversity');
const latestLinksContent = require('./fetch-landings');
const { postProcessLayer } = require('./postprocess');

const createClient = ({ endpoint, token }) => {
Expand Down Expand Up @@ -57,6 +58,7 @@ const getContent = async conferenceSettings => {
jobsContent,
committeeContent,
diversityContent,
latestLinksContent,
].map(async content => {
try {
getQueriesData(content, conferenceSettings);
Expand Down
Loading