Skip to content

Commit d6b7a0f

Browse files
committed
docs: update docs for many2many plugin
1 parent 2cc9ee7 commit d6b7a0f

File tree

1 file changed

+51
-1
lines changed

1 file changed

+51
-1
lines changed

adminforth/documentation/docs/tutorial/07-Plugins/22-many2many.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,4 +260,54 @@ By default, when you delete a realtor or an apartment, all related rows in the j
260260

261261
## Making editable fields for the both resources
262262

263-
There might be cases, when you want to make fields editable on both resources. For these cases you can just create second instance of plugin on the second resource and it will allow you to use this plugin from the both resources.
263+
There might be cases, when you want to make fields editable on both resources. For these cases you can just create second instance of plugin on the second resource and it will allow you to use this plugin from the both resources.
264+
265+
```ts title="./resources/apartments.ts"
266+
//diff-add
267+
import Many2ManyPlugin from '@adminforth/many2many';
268+
269+
...
270+
271+
plugins: [
272+
...
273+
274+
//diff-add
275+
new Many2ManyPlugin({
276+
//diff-add
277+
linkedResourceId: 'realtors',
278+
//diff-add
279+
})
280+
281+
...
282+
]
283+
284+
...
285+
286+
```
287+
288+
289+
and
290+
291+
292+
```ts title="./resources/realtors.ts"
293+
//diff-add
294+
import Many2ManyPlugin from '@adminforth/many2many';
295+
296+
...
297+
298+
plugins: [
299+
...
300+
301+
//diff-add
302+
new Many2ManyPlugin({
303+
//diff-add
304+
linkedResourceId: 'aparts',
305+
//diff-add
306+
})
307+
308+
...
309+
]
310+
311+
...
312+
313+
```

0 commit comments

Comments
 (0)