delete business
This commit is contained in:
@@ -148,11 +148,13 @@ export class BusinessesService {
|
||||
async remove(id: string): Promise<void> {
|
||||
await this.findOne(id);
|
||||
|
||||
const imageUrls = await this.images.listUrlsForBusiness(id);
|
||||
|
||||
await this.dataSource.transaction(async (manager) => {
|
||||
await deleteBusinessCascade(manager, id, async (businessId) => {
|
||||
await this.images.removeAllForBusiness(businessId);
|
||||
});
|
||||
await deleteBusinessCascade(manager, id);
|
||||
});
|
||||
|
||||
this.images.deleteFiles(imageUrls);
|
||||
}
|
||||
|
||||
async getAvailability(businessId: string) {
|
||||
|
||||
Reference in New Issue
Block a user