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
167167npm i @adminforth/storage-adapter-local --save
168168```
169169
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" ;
174174import { v1 as uuid } from " uuid" ;
175175
176176export default {
@@ -237,6 +237,20 @@ export default {
237237 ],
238238} as AdminForthResourceInput ;
239239```
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+ ```
240254
241255Next, add attachments to RichEditor plugin:
242256
Original file line number Diff line number Diff line change @@ -59,10 +59,10 @@ npm i @adminforth/upload --save
5959npm i @adminforth/storage-adapter-local --save
6060```
6161
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" ;
6666import { v1 as uuid } from " uuid" ;
6767
6868export default {
@@ -129,6 +129,20 @@ export default {
129129 ],
130130} as AdminForthResourceInput ;
131131```
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+ ```
132146
133147Next, add attachments to Markdown plugin:
134148
@@ -139,7 +153,7 @@ import MarkdownPlugin from '@adminforth/markdown';
139153
140154plugins : [
141155 new MarkdownPlugin ({
142- fieldName: " description"
156+ fieldName: " description" ,
143157// diff-add
144158 attachments: {
145159// diff-add
You can’t perform that action at this time.
0 commit comments