Skip to content

Commit b49e575

Browse files
committed
feat: add description for listPageSizeOptions function
1 parent 76a7d3d commit b49e575

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

adminforth/documentation/docs/tutorial/03-Customization/13-standardPagesTuning.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,22 @@ export default {
327327
options: {
328328
...
329329
listPageSize: 10,
330+
// listPageSizeOptions can be a static array
330331
//diff-add
331332
listPageSizeOptions: [10, 20, 50],
333+
// OR a function for dynamic options based on user role
334+
//diff-add
335+
listPageSizeOptions: ({ adminUser }) => {
336+
//diff-add
337+
if (adminUser?.dbUser?.role === 'superadmin') {
338+
//diff-add
339+
return [50, 100, 500];
340+
//diff-add
341+
}
342+
//diff-add
343+
return [10, 20, 50];
344+
//diff-add
345+
},
332346
}
333347
}
334348
]

0 commit comments

Comments
 (0)