From 47f8a120429eee4c0bb99265081e7d5343e05dbf Mon Sep 17 00:00:00 2001 From: DrMint <29893320+DrMint@users.noreply.github.com> Date: Fri, 12 Apr 2024 22:02:37 +0200 Subject: [PATCH] Fixed all preview urls --- .env.example | 4 +++- src/collections/Audios/Audios.ts | 2 +- src/collections/Collectibles/Collectibles.ts | 2 +- src/collections/Folders/Folders.ts | 2 +- src/collections/Images/Images.ts | 2 +- src/collections/Pages/Pages.ts | 2 +- src/collections/Videos/Videos.ts | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.env.example b/.env.example index cde30dd..aa808a3 100644 --- a/.env.example +++ b/.env.example @@ -20,4 +20,6 @@ SFTP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\nxxxxxxxxxx..." SFTP_USERNAME=someuser SFTP_HOST=host.com SFTP_DESTINATION_PATH_ROOT="/absolute/path/to/destination/root/folder" -SFTP_BASE_URL=https://base-url.com \ No newline at end of file +SFTP_BASE_URL=https://base-url.com + +PAYLOAD_PUBLIC_FRONTEND_BASE_URL=https://domain.com \ No newline at end of file diff --git a/src/collections/Audios/Audios.ts b/src/collections/Audios/Audios.ts index f04fa2a..f7c62fe 100644 --- a/src/collections/Audios/Audios.ts +++ b/src/collections/Audios/Audios.ts @@ -28,7 +28,7 @@ export const Audios = buildCollectionConfig({ defaultSort: fields.updatedAt, admin: { group: CollectionGroups.Media, - preview: ({ slug }) => `https://v3.accords-library.com/en/audios/${slug}`, + preview: ({ id }) => `${process.env.PAYLOAD_PUBLIC_FRONTEND_BASE_URL}/en/audios/${id}`, defaultColumns: [ fields.filename, fields.thumbnail, diff --git a/src/collections/Collectibles/Collectibles.ts b/src/collections/Collectibles/Collectibles.ts index 9d78042..797921e 100644 --- a/src/collections/Collectibles/Collectibles.ts +++ b/src/collections/Collectibles/Collectibles.ts @@ -128,7 +128,7 @@ export const Collectibles = buildVersionedCollectionConfig({ "A physical or digital item. This can be a book, a CD/DVD, a video game copy...\ any product related to our Scope.\ This can also include merchandises such as figurines, music boxes, posters, key chains...", - preview: ({ slug }) => `https://v3.accords-library.com/en/collectibles/${slug}`, + preview: ({ slug }) => `${process.env.PAYLOAD_PUBLIC_FRONTEND_BASE_URL}/en/collectibles/${slug}`, hooks: { beforeDuplicate: beforeDuplicatePiping([ beforeDuplicateUnpublish, diff --git a/src/collections/Folders/Folders.ts b/src/collections/Folders/Folders.ts index 46bb259..52e0874 100644 --- a/src/collections/Folders/Folders.ts +++ b/src/collections/Folders/Folders.ts @@ -38,7 +38,7 @@ export const Folders = buildCollectionConfig({ ], description: "Folders provide a way to structure our content. A folder can contain subfolders and/or files.", - preview: ({ slug }) => `https://v3.accords-library.com/en/folders/${slug}`, + preview: ({ slug }) => `${process.env.PAYLOAD_PUBLIC_FRONTEND_BASE_URL}/en/folders/${slug}`, }, endpoints: [getBySlugEndpoint], fields: [ diff --git a/src/collections/Images/Images.ts b/src/collections/Images/Images.ts index 79d3f76..10b1935 100644 --- a/src/collections/Images/Images.ts +++ b/src/collections/Images/Images.ts @@ -26,7 +26,7 @@ export const Images = buildImageCollectionConfig({ plural: "Images", }, admin: { - preview: ({ slug }) => `https://v3.accords-library.com/en/images/${slug}`, + preview: ({ id }) => `${process.env.PAYLOAD_PUBLIC_FRONTEND_BASE_URL}/en/images/${id}`, defaultColumns: [fields.filename, fields.posts, fields.updatedAt], }, upload: { diff --git a/src/collections/Pages/Pages.ts b/src/collections/Pages/Pages.ts index 21a5990..d7e5136 100644 --- a/src/collections/Pages/Pages.ts +++ b/src/collections/Pages/Pages.ts @@ -53,7 +53,7 @@ export const Pages = buildVersionedCollectionConfig({ fields.folders, ], group: CollectionGroups.Collections, - preview: ({ slug }) => `https://v3.accords-library.com/en/pages/${slug}`, + preview: ({ slug }) => `${process.env.PAYLOAD_PUBLIC_FRONTEND_BASE_URL}/en/pages/${slug}`, components: { BeforeListTable: [ () => diff --git a/src/collections/Videos/Videos.ts b/src/collections/Videos/Videos.ts index 32697a9..76cf779 100644 --- a/src/collections/Videos/Videos.ts +++ b/src/collections/Videos/Videos.ts @@ -37,7 +37,7 @@ export const Videos = buildCollectionConfig({ defaultSort: fields.updatedAt, admin: { group: CollectionGroups.Media, - preview: ({ slug }) => `https://v3.accords-library.com/en/videos/${slug}`, + preview: ({ id }) => `${process.env.PAYLOAD_PUBLIC_FRONTEND_BASE_URL}/en/videos/${id}`, defaultColumns: [ fields.filename, fields.thumbnail,