Skip to content

Commit

Permalink
implement feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
koechkevin committed Sep 27, 2023
1 parent 0ac3af1 commit 3217d23
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/codeforafrica/src/lib/data/pagify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ const COLLECTION_BY_SLUG = {
};

async function pagify(parentPage, api, context) {
const { slug: collection, meta = {} } = parentPage;
const { slug: collection } = parentPage;
const pageProps = COLLECTION_BY_SLUG[collection];
const props = (await pageProps?.(api, context)) ?? null;
return { ...props, meta };
return pageProps?.(api, context) ?? null;
}

export default pagify;
6 changes: 6 additions & 0 deletions apps/codeforafrica/src/lib/data/pagify/members.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ async function members(api, context) {
return null;
}
const [member] = docs;
const meta = {
title: member.name,
description: member.decription,
image: member.image,
};
return {
blocks: [
{
Expand All @@ -25,6 +30,7 @@ async function members(api, context) {
blockType: "about-page-entity",
},
],
meta,
};
}

Expand Down
6 changes: 6 additions & 0 deletions apps/codeforafrica/src/lib/data/pagify/partners.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ async function partners(api, context) {
return null;
}
const [partner] = docs;
const meta = {
title: partner.name,
description: partner.decription,
image: partner.image,
};
return {
blocks: [
{
Expand All @@ -24,6 +29,7 @@ async function partners(api, context) {
blockType: "about-page-entity",
},
],
meta,
};
}

Expand Down

0 comments on commit 3217d23

Please sign in to comment.