mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-16 03:55:41 +00:00
Report cache fix (#9447)
* Adjust allowed CORS headers * Disable caching in template preview
This commit is contained in:
@ -131,8 +131,17 @@ export function TemplateEditor(props: Readonly<TemplateEditorProps>) {
|
||||
|
||||
api.get(templateUrl).then((response: any) => {
|
||||
if (response.data?.template) {
|
||||
// Fetch the raw template file from the server
|
||||
// Request that it is provided without any caching,
|
||||
// to ensure that we always get the latest version
|
||||
api
|
||||
.get(response.data.template)
|
||||
.get(response.data.template, {
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache',
|
||||
Pragma: 'no-cache',
|
||||
Expires: '0'
|
||||
}
|
||||
})
|
||||
.then((res) => {
|
||||
codeRef.current = res.data;
|
||||
loadCodeToEditor(res.data);
|
||||
|
Reference in New Issue
Block a user