File tree 2 files changed +6
-2
lines changed
packages/frontend/components/textarea
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 74
74
hint : " Richtext hint text" ,
75
75
field : {
76
76
attributes : {
77
- editor : true
77
+ editor : true ,
78
+ " editor-endpoint" : application .mediaEndpoint
78
79
}
79
80
}
80
81
}) }}
Original file line number Diff line number Diff line change @@ -37,10 +37,12 @@ const getButtonSvg = (name) => {
37
37
export const TextareaFieldComponent = class extends HTMLElement {
38
38
connectedCallback ( ) {
39
39
this . editor = this . getAttribute ( "editor" ) ;
40
+
40
41
if ( this . editor !== "" ) {
41
42
return ;
42
43
}
43
44
45
+ this . editorEndpoint = this . getAttribute ( "editor-endpoint" ) ;
44
46
this . editorId = this . getAttribute ( "editor-id" ) ;
45
47
this . editorImageUpload = this . getAttribute ( "editor-image-upload" ) ;
46
48
this . editorLocale = this . getAttribute ( "editor-locale" ) ;
@@ -91,6 +93,7 @@ export const TextareaFieldComponent = class extends HTMLElement {
91
93
italic : "_" ,
92
94
} ,
93
95
element : this . $textarea ,
96
+ imageUploadEndpoint : this . editorEndpoint ,
94
97
imageUploadFunction : this . uploadFile ,
95
98
minHeight : "6rem" ,
96
99
previewClass : [ "editor-preview" , "s-flow" ] ,
@@ -150,7 +153,7 @@ export const TextareaFieldComponent = class extends HTMLElement {
150
153
formData . append ( "file" , file ) ;
151
154
152
155
try {
153
- const endpointResponse = await fetch ( "http://localhost:3000/media" , {
156
+ const endpointResponse = await fetch ( this . options . imageUploadEndpoint , {
154
157
method : "POST" ,
155
158
body : formData ,
156
159
} ) ;
You can’t perform that action at this time.
0 commit comments