We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8dfc690 commit 5744f09Copy full SHA for 5744f09
adminforth/commands/createApp/templates/adminuser.ts.hbs
@@ -1,5 +1,6 @@
1
import AdminForth, { AdminForthDataTypes } from 'adminforth';
2
import type { AdminForthResourceInput, AdminForthResource, AdminUser } from 'adminforth';
3
+import { randomUUID } from 'crypto';
4
5
async function canModifyUsers({ adminUser }: { adminUser: AdminUser }): Promise<boolean> {
6
return adminUser.dbUser.role === 'superadmin';
@@ -22,7 +23,7 @@ export default {
22
23
name: 'id',
24
primaryKey: true,
25
type: AdminForthDataTypes.STRING,
- fillOnCreate: ({ initialRecord, adminUser }) => Math.random().toString(36).substring(7),
26
+ fillOnCreate: ({ initialRecord, adminUser }) => randomUUID(),
27
showIn: {
28
edit: false,
29
create: false,
0 commit comments