fix(medusa): Product model before insert hook (#5200)
**What** When the id is provided, the rest of the hook should still apply. At the moment, when the id is provided the hook is skipped
This commit is contained in:
1 parent
2caff2efc7
commit
240c439beb
6 files changed
+26
-21
No files matched your search
@@ -193,9 +193,8 @@ export class Product extends SoftDeletableEntity {
|
||||
|
||||
@BeforeInsert()
|
||||
private beforeInsert(): void {
|
||||
if (this.id) return
|
||||
|
||||
this.id = generateEntityId(this.id, "prod")
|
||||
|
||||
if (!this.handle) {
|
||||
this.handle = _.kebabCase(this.title)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user