4.3.2 • Published 10 months ago
matcha-keystone-utils v4.3.2
Keystone Utils
Relationship required
Relationship field validator, raising a validation error when relationship doesn't have at least one object.
Like the isRequired: true
on other fields.
Usage
- Add
validateInput: relationRequiredValidateInput
in the hooks of the relationship field
Example
See testSchema/relationshipRequired/index.ts.
Cascade delete
On a 1-to-1 or 1-to-many relationship:
- Delete children when parent is deleted
- Do not delete children when they are removed from parent relation
Usage
- Use
beforeOperationDeleteOne({ ref: "<child ref>" })
for one-to-one relationships andbeforeOperationDeleteMany({ ref: "<child ref>" })
for one-to-many relationships - The ref value must be the same as the ref config of the relationship field
- Add it as a before operation hook to relationship fields you want to cascade delete
Example
See testSchema/cascadeDelete/oneToOne.ts and testSchema/cascadeDelete/oneToMany.ts.
History Beta
Usage
- Add the History schema to your lists using
getHistoryEntity()
- Add the
afterOperationSaveHistory
hook to any object you want to historize
Example
4.3.2
10 months ago
4.3.1
10 months ago
4.3.0
11 months ago
3.2.2
1 year ago
3.2.1
1 year ago
3.2.0
1 year ago
3.1.0
1 year ago
3.0.0
1 year ago
4.1.0
1 year ago
4.0.0
1 year ago
4.2.1
1 year ago
4.2.0
1 year ago
2.0.0
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago
0.3.0
2 years ago
0.2.2
2 years ago
0.2.1
2 years ago
0.2.0
2 years ago
0.1.1
2 years ago
0.1.0
2 years ago