Schema changed for commercials

This commit is contained in:
2024-05-22 17:34:50 -05:00
parent d6768b3da9
commit 13fb3cd4b8
8 changed files with 34 additions and 512 deletions

View File

@@ -20,7 +20,7 @@
</div>
<div class="mr-5 mt-3">
<span class="font-medium text-500">For Sale</span>
<div class="text-700 mt-2">{{ businessListings.length + commercialPropListings.length }}</div>
<div class="text-700 mt-2">{{ businessListings?.length + commercialPropListings?.length }}</div>
</div>
<!-- <div class="mr-5 mt-3">
<span class="font-medium text-500">Sold</span>

View File

@@ -20,7 +20,7 @@ import { EditorModule } from 'primeng/editor';
import { FileUpload, FileUploadModule } from 'primeng/fileupload';
import { v4 as uuidv4 } from 'uuid';
import { BusinessListing, CommercialPropertyListing, User } from '../../../../../../bizmatch-server/src/models/db.model';
import { AutoCompleteCompleteEvent, ImageProperty } from '../../../../../../bizmatch-server/src/models/main.model';
import { AutoCompleteCompleteEvent, ImageProperty, emailToDirName } from '../../../../../../bizmatch-server/src/models/main.model';
import { environment } from '../../../../environments/environment';
import { ImageCropperComponent } from '../../../components/image-cropper/image-cropper.component';
import { InputNumberModule } from '../../../components/inputnumber/inputnumber.component';
@@ -132,7 +132,7 @@ export class EditCommercialPropertyListingComponent {
} else {
this.listing = createDefaultCommercialPropertyListing();
this.listing.userId = await this.userService.getId(keycloakUser.email);
this.listing.imagePath = uuidv4();
this.listing.imagePath = `${emailToDirName(keycloakUser.email)}_${uuidv4()}`;
if (this.data) {
this.listing.title = this.data?.title;
this.listing.description = this.data?.description;