Skip to content

Commit 36cc51d

Browse files
authored
fix: add fillOnCreate function type (#151)
1 parent ed638c4 commit 36cc51d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

adminforth/types/Common.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,11 @@ export interface AdminForthForeignResourceCommon {
556556
unsetLabel?: string,
557557
}
558558

559+
export type FillOnCreateFunction = (params: {
560+
initialRecord: any,
561+
adminUser: AdminUser,
562+
}) => any;
563+
559564
/**
560565
* Column describes one field in the table or collection in database.
561566
*/
@@ -686,7 +691,7 @@ export interface AdminForthResourceColumnInputCommon {
686691
/**
687692
* Called on the backend when the record is saved to a database. Value returned by `fillOnCreate` will be saved to the database.
688693
*/
689-
fillOnCreate?: Function,
694+
fillOnCreate?: FillOnCreateFunction,
690695

691696
/**
692697
* Single value that will be substituted in create form. User can change it before saving the record.

0 commit comments

Comments
 (0)