Add business images upload and cascade delete improvements.
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
import { BookingEntity } from './booking.entity';
|
||||
import { BusinessAttributeValueEntity } from './business-attribute-value.entity';
|
||||
import { BusinessCategoryEntity } from './business-category.entity';
|
||||
import { BusinessImageEntity } from './business-image.entity';
|
||||
import { BusinessServiceEntity } from './business-service.entity';
|
||||
import { UserEntity } from './user.entity';
|
||||
|
||||
@@ -62,6 +63,11 @@ export class BusinessEntity {
|
||||
@Column({ type: 'uuid', nullable: true })
|
||||
ownerId!: string | null;
|
||||
|
||||
@OneToMany(() => BusinessImageEntity, (image) => image.business, {
|
||||
cascade: true,
|
||||
})
|
||||
images!: BusinessImageEntity[];
|
||||
|
||||
@OneToMany(() => BusinessServiceEntity, (service) => service.business)
|
||||
services!: BusinessServiceEntity[];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user