Skip to content

Commit

Permalink
🐛 Fixed resolvers
Browse files Browse the repository at this point in the history
  • Loading branch information
KenAJoh committed Dec 6, 2023
1 parent 9ece2a8 commit d9aade1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export function runResolvers({
getNestedProperty(_acc, key)
);

_acc[resolver.key] = resolver.cb(dataFromKeys);
if (dataFromKeys.filter((x) => !!x).length > 0) {
_acc[resolver.key] = resolver.cb(dataFromKeys);
}

return _acc;
}, data);
}
Expand Down
21 changes: 15 additions & 6 deletions aksel.nav.no/website/pages/gp/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,21 @@ const Wrapper = (props: any) => {
{
key: "views",
dataKeys: ["articles"],
cb: (v) => [
{
title: "Siste",
articles: v,
},
],
cb: (v) => {
return [
{
title: "Siste",
articles: v,
},
];
},
},
{
key: "articles",
dataKeys: ["articles"],
cb: () => {
return undefined;
},
},
]}
/>
Expand Down

0 comments on commit d9aade1

Please sign in to comment.