Skip to content

Commit

Permalink
Fix file import during page copy (#1503)
Browse files Browse the repository at this point in the history
Previously, **all files were downloaded and uploaded again when copying
within the same environment**.

This bug is caused because our deployed projects use the CDN URL for the
fileUrl and the API URL doesn't match the CDN URL
  • Loading branch information
thomasdax98 authored Dec 14, 2023
1 parent a677a16 commit 0fdf4ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .changeset/many-melons-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@comet/cms-admin": patch
---


Always use the `/preview` file URLs in the admin application

This is achieved by setting the `x-preview-dam-urls` in the `includeInvisibleContentContext`.

This fixes a page copy bug where all files were downloaded and uploaded again, even when copying within the same environment.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const includeInvisibleContentContext = setContext((request, prevContext)
headers: {
...prevContext.headers,
"x-include-invisible-content": ["Pages:Unpublished", "Pages:Archived", "Blocks:Invisible"],
"x-preview-dam-urls": "1",
},
};
});

0 comments on commit 0fdf4ea

Please sign in to comment.