Skip to content

Commit

Permalink
edit: url or imgix_url to get filename
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyspiro committed Sep 7, 2024
1 parent 0b2fd89 commit a21857e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/addFullMedia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ const mapMediaDataToResponse = (
if (obj && typeof obj === 'object') {
Object.keys(obj).forEach((key) => {
if (obj[key] && typeof obj[key] === 'object') {
if (obj[key].url && obj[key].imgix_url) {
const filename = obj[key].url.split('/').pop().split('?')[0];
const url = obj[key].imgix_url || obj[key].url;
if (url) {
const filename = url.split('/').pop().split('?')[0];
if (mediaMap.has(filename)) {
// eslint-disable-next-line no-param-reassign
if (!props.includes('name')) {
Expand Down

0 comments on commit a21857e

Please sign in to comment.