fix: model.beforeCreate not called (#343)

* fix: model.beforeCreate not called

* chore: condition
This commit is contained in:
ChengLei Shao 2022-04-29 21:42:54 +08:00 committed by GitHub
parent 4612739021
commit b4b97b9f30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,7 @@ export class ModelHook {
findModelName(hookArgs) {
for (const arg of hookArgs) {
if (arg instanceof Model) {
if (arg?._previousDataValues) {
return (<Model>arg).constructor.name;
}