Skip to content

Commit

Permalink
Make Tages unique to only projects
Browse files Browse the repository at this point in the history
  • Loading branch information
koechkevin committed Sep 28, 2023
1 parent 39e7f3e commit e7bc3d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/codeforafrica/src/lib/data/blockify/ourWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { getProjects } from "@/codeforafrica/lib/data/utils/projects";
async function ourWork(block, api, context) {
const { query } = context;
const data = await getProjects(api, query);
const { docs } = await api.getCollection("tag");
const tags = docs.map(({ name }) => name);
const { docs: allProjects } = await api.getCollection("projects");
const projectTags = allProjects.map(({ tag }) => tag?.name).filter(Boolean);
const tags = ["All", ...new Set(projectTags)];

return {
tags,
Expand Down

0 comments on commit e7bc3d2

Please sign in to comment.