Skip to content

Commit a929a98

Browse files
committed
docs: reorganize UserSoftDelete plugin setup in documentation
1 parent 743ab1c commit a929a98

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

adminforth/documentation/docs/tutorial/07-Plugins/19-user-soft-delete.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,6 @@ import UserSoftDelete from "@adminforth/user-soft-delete";
4141

4242
...
4343

44-
new UserSoftDelete({
45-
activeFieldName: "is_active",
46-
//in canDeactivate we pass a function, that specify adminusers roles, which can seactivate other adminusers
47-
canDeactivate: async (adminUser: AdminUser) => {
48-
if (adminUser.dbUser.role === "superadmin") {
49-
return true;
50-
}
51-
return false;
52-
}
53-
}),
54-
55-
...
56-
5744
columns[
5845

5946
...
@@ -77,6 +64,27 @@ columns[
7764

7865
...
7966

67+
]
68+
69+
...
70+
71+
plugins: [
72+
73+
...
74+
75+
new UserSoftDelete({
76+
activeFieldName: "is_active",
77+
//in canDeactivate we pass a function, that specify adminusers roles, which can seactivate other adminusers
78+
canDeactivate: async (adminUser: AdminUser) => {
79+
if (adminUser.dbUser.role === "superadmin") {
80+
return true;
81+
}
82+
return false;
83+
}
84+
}),
85+
86+
...
87+
8088
]
8189
```
8290

0 commit comments

Comments
 (0)