Skip to content

Commit 30b8fbf

Browse files
authored
Merge pull request #294 from devforth/AdminForth/748
docs: fix docs
2 parents 1ef4500 + 5ae8910 commit 30b8fbf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

adminforth/types/Back.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,13 +1346,13 @@ export interface AdminForthResource extends Omit<AdminForthResourceInput, 'optio
13461346
},
13471347
create?: {
13481348
/**
1349-
* Should return ok: true to continue saving pipeline and allow creating record in database, and ok: false to interrupt pipeline and prevent record creation.
1350-
* If you need to show error on UI, set error: <error message> in response.
1349+
* Should return `ok: true` to continue saving pipeline and allow creating record in database, and `ok: false` to interrupt pipeline and prevent record creation.
1350+
* If you need to show error on UI, set `error: \<error message\>` in response.
13511351
*
13521352
* Typical use-cases:
1353-
* - Create record by custom code (return `{ ok: false, newRecordId: <id of created record from custom code>}`)
1354-
* - Validate record before saving to database and interrupt execution if validation failed (return `{ok: false, error: <validation error>}`), though `allowedActions.create` should be preferred in most cases
1355-
* - fill-in adminUser as creator of record (set record.<some field> = x; return {ok: true})
1353+
* - Create record by custom code (return `{ ok: false, newRecordId: <id of created record from custom code> }`)
1354+
* - Validate record before saving to database and interrupt execution if validation failed (return `{ ok: false, error: <validation error> }`), though `allowedActions.create` should be preferred in most cases
1355+
* - fill-in adminUser as creator of record (set `record.<some field> = x; return \{ ok: true \}`)
13561356
* - Attach additional data to record before saving to database (mostly fillOnCreate should be used instead)
13571357
*/
13581358
beforeSave?: Array<BeforeCreateSaveFunction>,

0 commit comments

Comments
 (0)