File tree Expand file tree Collapse file tree 2 files changed +37
-9
lines changed
adminforth/documentation/docs/tutorial/05-Plugins Expand file tree Collapse file tree 2 files changed +37
-9
lines changed Original file line number Diff line number Diff line change @@ -167,10 +167,10 @@ npm i @adminforth/upload --save
167
167
npm i @adminforth/storage-adapter-local --save
168
168
```
169
169
170
- ``` typescript title="./resources/description_image .ts"
171
- import AdminForthStorageAdapterLocalFilesystem from " ../../adapters/ adminforth- storage-adapter-local" ;
172
- import { AdminForthResourceInput } from " ../../ adminforth" ;
173
- import UploadPlugin from " ../../plugins/ adminforth- upload" ;
170
+ ``` typescript title="./resources/description_images .ts"
171
+ import AdminForthStorageAdapterLocalFilesystem from " @ adminforth/ storage-adapter-local" ;
172
+ import { AdminForthResourceInput } from " adminforth" ;
173
+ import UploadPlugin from " @ adminforth/ upload" ;
174
174
import { v1 as uuid } from " uuid" ;
175
175
176
176
export default {
@@ -237,6 +237,20 @@ export default {
237
237
],
238
238
} as AdminForthResourceInput ;
239
239
```
240
+ Next, add new resource to ` index.ts ` :
241
+
242
+ ``` typescript title="./index.ts"
243
+ import descriptionImage from ' ./resources/description_images.js' ;
244
+
245
+ ...
246
+
247
+ resources : [
248
+ usersResource ,
249
+ apartments ,
250
+ // diff-add
251
+ descriptionImage
252
+ ],
253
+ ```
240
254
241
255
Next, add attachments to RichEditor plugin:
242
256
Original file line number Diff line number Diff line change @@ -59,10 +59,10 @@ npm i @adminforth/upload --save
59
59
npm i @adminforth/storage-adapter-local --save
60
60
```
61
61
62
- ``` typescript title="./resources/description_image .ts"
63
- import AdminForthStorageAdapterLocalFilesystem from " ../../adapters/ adminforth- storage-adapter-local" ;
64
- import { AdminForthResourceInput } from " ../../ adminforth" ;
65
- import UploadPlugin from " ../../plugins/ adminforth- upload" ;
62
+ ``` typescript title="./resources/description_images .ts"
63
+ import AdminForthStorageAdapterLocalFilesystem from " @ adminforth/ storage-adapter-local" ;
64
+ import { AdminForthResourceInput } from " adminforth" ;
65
+ import UploadPlugin from " @ adminforth/ upload" ;
66
66
import { v1 as uuid } from " uuid" ;
67
67
68
68
export default {
@@ -129,6 +129,20 @@ export default {
129
129
],
130
130
} as AdminForthResourceInput ;
131
131
```
132
+ Next, add new resource to ` index.ts ` :
133
+
134
+ ``` typescript title="./index.ts"
135
+ import descriptionImage from ' ./resources/description_images.js' ;
136
+
137
+ ...
138
+
139
+ resources : [
140
+ usersResource ,
141
+ apartments ,
142
+ // diff-add
143
+ descriptionImage
144
+ ],
145
+ ```
132
146
133
147
Next, add attachments to Markdown plugin:
134
148
@@ -139,7 +153,7 @@ import MarkdownPlugin from '@adminforth/markdown';
139
153
140
154
plugins : [
141
155
new MarkdownPlugin ({
142
- fieldName: " description"
156
+ fieldName: " description" ,
143
157
// diff-add
144
158
attachments: {
145
159
// diff-add
You can’t perform that action at this time.
0 commit comments