Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Simplify resolution and remove error logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinsina authored Mar 14, 2024
1 parent d713f0f commit b45ee18
Showing 1 changed file with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,8 @@ $ const timestamp = date ? dateToTimestamp(date) : undefined;
req,
debug,
})>
$ const resolvedData = get(resolved, "data");
$ const dataIsArray = Array.isArray(resolvedData);
$ if (resolvedData && dataIsArray && resolvedData.length) {
if (resolvedData.find((datapoint) => !get(datapoint, 'creative.mindfulCreativeId'))) {
throw new Error('Unable to parse mindful creative id(s) from ad response.');
}
} else if (resolvedData && !dataIsArray) {
if (!get(resolved, "data.creative.mindfulCreativeId")) {
throw new Error('Unable to parse mindful creative id from ad response.');
}
}
$ const mindfulCreativeId = get(resolved, "data.creative.mindfulCreativeId");
<${input.renderBody}
data=resolved.data
creative-id=mindfulCreativeId
tenant=mindfulTenant
/>
</marko-web-resolve>
Expand Down

0 comments on commit b45ee18

Please sign in to comment.