From 8a6a31372f8075b0f82aea63fcb2b7bc7ef652b1 Mon Sep 17 00:00:00 2001 From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Fri, 25 Oct 2024 08:48:30 +0300 Subject: [PATCH] Used named params in propsifyBlock --- apps/climatemappedafrica/src/lib/data/blockify/explore-page.js | 2 +- apps/climatemappedafrica/src/lib/data/blockify/hero.js | 2 +- apps/climatemappedafrica/src/lib/data/blockify/index.js | 2 +- apps/climatemappedafrica/src/lib/data/blockify/page-hero.js | 2 +- apps/climatemappedafrica/src/lib/data/blockify/team.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/climatemappedafrica/src/lib/data/blockify/explore-page.js b/apps/climatemappedafrica/src/lib/data/blockify/explore-page.js index 2d326c7d8..509b6d341 100644 --- a/apps/climatemappedafrica/src/lib/data/blockify/explore-page.js +++ b/apps/climatemappedafrica/src/lib/data/blockify/explore-page.js @@ -3,7 +3,7 @@ import { fetchProfileGeography, } from "@/climatemappedafrica/lib/hurumap"; -async function explorePage({ slugs }, _, __, hurumap) { +async function explorePage({ block: { slugs }, hurumap }) { const { initialLocation, page: { value }, diff --git a/apps/climatemappedafrica/src/lib/data/blockify/hero.js b/apps/climatemappedafrica/src/lib/data/blockify/hero.js index 4983af2b2..f6c7cefbc 100644 --- a/apps/climatemappedafrica/src/lib/data/blockify/hero.js +++ b/apps/climatemappedafrica/src/lib/data/blockify/hero.js @@ -3,7 +3,7 @@ import { fetchProfileGeography, } from "@/climatemappedafrica/lib/hurumap"; -export default async function hero(block, _, __, hurumap) { +export default async function hero({ block, hurumap }) { const { initialLocation: { center, name }, } = hurumap; diff --git a/apps/climatemappedafrica/src/lib/data/blockify/index.js b/apps/climatemappedafrica/src/lib/data/blockify/index.js index f81829636..d8a83f9fe 100644 --- a/apps/climatemappedafrica/src/lib/data/blockify/index.js +++ b/apps/climatemappedafrica/src/lib/data/blockify/index.js @@ -18,7 +18,7 @@ export const blockify = async (blocks, api, context, hurumap) => { const propsifyBlock = propsifyBlockBySlug[slug]; if (propsifyBlock) { - return propsifyBlock(block, api, context, hurumap); + return propsifyBlock({ block, api, context, hurumap }); } return { ...block, diff --git a/apps/climatemappedafrica/src/lib/data/blockify/page-hero.js b/apps/climatemappedafrica/src/lib/data/blockify/page-hero.js index 0a732a785..1be4c04a4 100644 --- a/apps/climatemappedafrica/src/lib/data/blockify/page-hero.js +++ b/apps/climatemappedafrica/src/lib/data/blockify/page-hero.js @@ -1,6 +1,6 @@ import { imageFromMedia } from "@/climatemappedafrica/lib/data/utils"; -async function pageHero(block) { +async function pageHero({ block }) { const { background: media, ...others } = block; let background = null; if (media) { diff --git a/apps/climatemappedafrica/src/lib/data/blockify/team.js b/apps/climatemappedafrica/src/lib/data/blockify/team.js index ccc51693e..74c51abf6 100644 --- a/apps/climatemappedafrica/src/lib/data/blockify/team.js +++ b/apps/climatemappedafrica/src/lib/data/blockify/team.js @@ -8,7 +8,7 @@ import { equalsIgnoreCase } from "@/climatemappedafrica/utils"; const getCountryFromCode = (alpha3) => countries.find((c) => equalsIgnoreCase(c.alpha3, alpha3)) ?? null; -async function team(block, api, context) { +async function team({ block, api, context }) { const { query } = context; const data = await getMembers(api, query); let members = null;