File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed
form/components/fields/upload Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1+
2+
3+ export const CURRENT_PAGE_URL = 'X-Current-Page-Url' ;
Original file line number Diff line number Diff line change 11import { parseBlobJSONContent } from "@/utils/request" ;
22import { handleErrorAlert } from "./errors" ;
33import { Axios , AxiosError , isCancel } from "axios" ;
4+ import { CURRENT_PAGE_URL } from "@/api/headers" ;
45
56declare module 'axios' {
67 interface AxiosRequestConfig {
@@ -9,7 +10,6 @@ declare module 'axios' {
910 }
1011}
1112
12-
1313export function installInterceptors ( api : Axios ) {
1414 api . interceptors . request . use ( request => {
1515 if ( request . preloaded ) {
@@ -23,7 +23,7 @@ export function installInterceptors(api: Axios) {
2323 } as RequestInit ;
2424 }
2525 } else {
26- request . headers [ 'X-Current-Page-Url' ] = location . href ;
26+ request . headers [ CURRENT_PAGE_URL ] = location . href ;
2727 }
2828 return request ;
2929 } ) ;
Original file line number Diff line number Diff line change 4444 import { useFieldContainerData } from " @/form/useFieldContainerData" ;
4545 import { useParentEditor } from " @/form/components/fields/editor/useParentEditor" ;
4646 import { useParentListField } from " @/form/components/fields/list/useParentListField" ;
47+ import { CURRENT_PAGE_URL } from " @/api/headers" ;
4748
4849 const props = defineProps < FormFieldProps < FormUploadFieldData > & {
4950 asEditorEmbed?: boolean ,
119120 headers: {
120121 ' Accept' : ' application/json' ,
121122 ' X-CSRF-TOKEN' : getCsrfToken (),
123+ [CURRENT_PAGE_URL ]: location .href ,
122124 },
123125 })
124126 .on (' file-added' , async (file ) => {
You can’t perform that action at this time.
0 commit comments