Skip to content

Commit

Permalink
fix: query params
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyspiro committed Sep 4, 2024
1 parent 0964d56 commit 0b2fd89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/addFullMedia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const extractMediaFiles = (obj: any): string[] => {
JSON.stringify(obj, (_, value) => {
if (value && typeof value === 'object') {
if (value.url && value.imgix_url) {
mediaFiles.push(value.url.split('/').pop());
mediaFiles.push(value.url.split('/').pop().split('?')[0]);
}
}
return value;
Expand All @@ -37,7 +37,7 @@ const mapMediaDataToResponse = (
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('?')[0].split('/').pop();
const filename = obj[key].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 0b2fd89

Please sign in to comment.