reset criteria on home, show filter on home, new BOM generation, Schema overhaul
This commit is contained in:
@@ -77,6 +77,7 @@ export class AccountComponent {
|
||||
this.user = await this.userService.getByMail(email);
|
||||
} catch (e) {
|
||||
this.user = {
|
||||
id: undefined,
|
||||
email,
|
||||
firstname: keycloakUser.firstName,
|
||||
lastname: keycloakUser.lastName,
|
||||
|
||||
@@ -120,7 +120,7 @@ export class EditCommercialPropertyListingComponent {
|
||||
const token = await this.keycloakService.getToken();
|
||||
const keycloakUser = map2User(token);
|
||||
if (this.mode === 'edit') {
|
||||
this.listing = await lastValueFrom(this.listingsService.getListingById(this.id, 'commercialProperty'));
|
||||
this.listing = (await lastValueFrom(this.listingsService.getListingById(this.id, 'commercialProperty'))) as CommercialPropertyListing;
|
||||
} else {
|
||||
this.listing = createDefaultCommercialPropertyListing();
|
||||
const listingUser = await this.userService.getByMail(keycloakUser.email);
|
||||
@@ -134,7 +134,7 @@ export class EditCommercialPropertyListingComponent {
|
||||
}
|
||||
|
||||
async save() {
|
||||
this.listing = await this.listingsService.save(this.listing, this.listing.listingsCategory);
|
||||
this.listing = (await this.listingsService.save(this.listing, this.listing.listingsCategory)) as CommercialPropertyListing;
|
||||
this.router.navigate(['editCommercialPropertyListing', this.listing.id]);
|
||||
this.messageService.addMessage({ severity: 'success', text: 'Listing changes have been persisted', duration: 3000 });
|
||||
}
|
||||
@@ -166,7 +166,7 @@ export class EditCommercialPropertyListingComponent {
|
||||
if (this.croppedImage) {
|
||||
this.imageService.uploadImage(this.croppedImage, 'uploadPropertyPicture', this.listing.imagePath, this.listing.serialId).subscribe(
|
||||
async () => {
|
||||
this.listing = await lastValueFrom(this.listingsService.getListingById(this.id, 'commercialProperty'));
|
||||
this.listing = (await lastValueFrom(this.listingsService.getListingById(this.id, 'commercialProperty'))) as CommercialPropertyListing;
|
||||
this.closeModal();
|
||||
},
|
||||
error => {
|
||||
@@ -182,7 +182,7 @@ export class EditCommercialPropertyListingComponent {
|
||||
this.listing.imageOrder = this.listing.imageOrder.filter(item => item !== imageName);
|
||||
await this.imageService.deleteListingImage(this.listing.imagePath, this.listing.serialId, imageName);
|
||||
await this.listingsService.save(this.listing, 'commercialProperty');
|
||||
this.listing = await lastValueFrom(this.listingsService.getListingById(this.id, 'commercialProperty'));
|
||||
this.listing = (await lastValueFrom(this.listingsService.getListingById(this.id, 'commercialProperty'))) as CommercialPropertyListing;
|
||||
this.messageService.addMessage({ severity: 'success', text: 'Image has been deleted', duration: 3000 });
|
||||
} else {
|
||||
console.log('deny');
|
||||
|
||||
Reference in New Issue
Block a user