BugFix deletion of prop images

This commit is contained in:
2024-05-16 10:08:23 -05:00
parent f51a298227
commit 492c03c2be
3 changed files with 8 additions and 8 deletions

View File

@@ -201,7 +201,7 @@ export class EditCommercialPropertyListingComponent {
accept: async () => {
this.listing.imageOrder = this.listing.imageOrder.filter(item => item !== imageName);
await Promise.all([this.imageService.deleteListingImage(this.listing.id, imageName), this.listingsService.save(this.listing, 'commercialProperty')]);
await Promise.all([this.imageService.deleteListingImage(this.listing.imagePath, imageName), this.listingsService.save(this.listing, 'commercialProperty')]);
this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Image deleted' });
this.propertyImages = await this.listingsService.getPropertyImages(this.listing.id);
},

View File

@@ -26,8 +26,8 @@ export class ImageService {
async deleteUserImage(userid: string, type: ImageType, name?: string) {
return await lastValueFrom(this.http.delete<[]>(`${this.apiBaseUrl}/bizmatch/image/${type.delete}${userid}`));
}
async deleteListingImage(listingid: string, name?: string) {
return await lastValueFrom(this.http.delete<[]>(`${this.apiBaseUrl}/bizmatch/image/propertyPicture/${listingid}/${name}`));
async deleteListingImage(imagePath: string, name?: string) {
return await lastValueFrom(this.http.delete<[]>(`${this.apiBaseUrl}/bizmatch/image/propertyPicture/${imagePath}/${name}`));
}
async getProfileImagesForUsers(userids: string[]) {
return await lastValueFrom(this.http.get<[]>(`${this.apiBaseUrl}/bizmatch/image/profileImages/${userids.join(',')}`));