Skip to content

Commit

Permalink
Merge pull request #788 from prezly/feature/care-6365-update-the-base…
Browse files Browse the repository at this point in the history
…-assets-url-for-gallery-download-link

[CARE-6365] Fix - Add secondary base url for assets that Uploadcare recommends
  • Loading branch information
mohammadxali authored Oct 9, 2024
2 parents 979a94e + 04bf4cb commit ca0e78d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/core/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const ASSETS_CDN_URL = 'https://cdn.uc.assets.prezly.com';
export const ASSETS_SECONDARY_CDN_URL = 'https://ucarecdn.com';
export const DEFAULT_PAGE_SIZE = 12;
export const DEFAULT_GALLERY_PAGE_SIZE = 6;
export const OG_IMAGE_API_URL = 'https://og.prezly.com/api/og';
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/galleries.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { NewsroomGallery, UploadedImage } from '@prezly/sdk';

import { ASSETS_CDN_URL } from './constants';
import { ASSETS_SECONDARY_CDN_URL } from './constants';

export function isEmpty(
gallery: Pick<NewsroomGallery, 'images_number' | 'videos_number'>,
Expand Down Expand Up @@ -36,5 +36,5 @@ export function getArchiveDownloadUrl(
// Uploadcare doesn't like slashes in filenames even in encoded form.
const filename = encodeURIComponent(title.replace(/\//g, '_'));

return `${ASSETS_CDN_URL}/${uuid}/archive/zip/${filename}.zip`;
return `${ASSETS_SECONDARY_CDN_URL}/${uuid}/archive/zip/${filename}.zip`;
}

0 comments on commit ca0e78d

Please sign in to comment.