Skip to content

Commit

Permalink
fix(strapi-cms): Temporary fix to allow media asset URLs to work both…
Browse files Browse the repository at this point in the history
… in production and locally
  • Loading branch information
relyks committed Aug 29, 2023
1 parent 58abd12 commit 9c8d3c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion static/js/Promotions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ const SidebarAd = React.memo(({ context, matchingAd }) => {
>
{matchingAd.buttonIcon?.data ? (
<img
src={STRAPI_INSTANCE + matchingAd.buttonIcon.data.attributes.url}
// TODO: Create middleware to handle serving media assets to distinguish between different environments
// The absolute path is needed for debugging purposes to get the media asset from the local Strapi server
// The local Strapi instance provides a relative path through the API
src={(matchingAd.debug ? STRAPI_INSTANCE : '') + matchingAd.buttonIcon.data.attributes.url}
alt={matchingAd.buttonIcon.data.attributes.alternativeText}
aria-hidden="true"
/>
Expand Down

0 comments on commit 9c8d3c4

Please sign in to comment.