Umbau auf postgres 2. step

This commit is contained in:
2024-04-22 22:26:44 +02:00
parent c90d6b72b7
commit 7f0f21b598
77 changed files with 3325 additions and 3066 deletions

View File

@@ -2,7 +2,7 @@ import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { environment } from '../../environments/environment';
import { lastValueFrom } from 'rxjs';
import { ImageType } from '../../../../common-models/src/main.model';
import { ImageType } from '../../../../bizmatch-server/src/models/main.model';
@Injectable({
providedIn: 'root'

View File

@@ -2,9 +2,10 @@ import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable, lastValueFrom } from 'rxjs';
import { environment } from '../../environments/environment';
import { BusinessListing, CommercialPropertyListing, ImageProperty, ListingCriteria, ListingType, ResponseBusinessListing, ResponseBusinessListingArray, ResponseCommercialPropertyListing, ResponseCommercialPropertyListingArray } from '../../../../common-models/src/main.model';
import onChange from 'on-change';
import { getSessionStorageHandler } from '../utils/utils';
import { getListingType, getSessionStorageHandler } from '../utils/utils';
import { ImageProperty, ListingCriteria, ListingType, ResponseBusinessListingArray, ResponseCommercialPropertyListingArray } from '../../../../bizmatch-server/src/models/main.model';
import { BusinessListing } from '../../../../bizmatch-server/src/models/db.model';
@Injectable({
providedIn: 'root'
@@ -17,8 +18,8 @@ export class ListingsService {
// getAllListings():Observable<ListingType[]>{
// return this.http.get<ListingType[]>(`${this.apiBaseUrl}/bizmatch/business-listings`);
// }
async getListings(criteria:ListingCriteria):Promise<ListingType[]>{
const result = await lastValueFrom(this.http.post<ResponseBusinessListingArray|ResponseCommercialPropertyListingArray>(`${this.apiBaseUrl}/bizmatch/listings/${criteria.listingsCategory}/search`,criteria));
async getListings(criteria:ListingCriteria,listingsCategory:'business'|'professionals_brokers'|'commercialProperty'):Promise<ListingType[]>{
const result = await lastValueFrom(this.http.post<ResponseBusinessListingArray>(`${this.apiBaseUrl}/bizmatch/listings/${listingsCategory}/search`,criteria));
return result.data;
}
getListingById(id:string,listingsCategory?:'business'|'commercialProperty'):Observable<ListingType>{

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@angular/core';
import { MailInfo } from '../../../../common-models/src/main.model';
import { HttpClient } from '@angular/common/http';
import { environment } from '../../environments/environment';
import { lastValueFrom } from 'rxjs';
import { MailInfo } from '../../../../bizmatch-server/src/models/main.model';
@Injectable({
providedIn: 'root'

View File

@@ -3,7 +3,7 @@ import { HttpClient } from '@angular/common/http';
import { InitEditableRow } from 'primeng/table';
import { lastValueFrom } from 'rxjs';
import { environment } from '../../environments/environment';
import { KeyValue, KeyValueStyle } from '../../../../common-models/src/main.model';
import { KeyValue, KeyValueStyle } from '../../../../bizmatch-server/src/models/main.model';
@Injectable({
providedIn: 'root',
@@ -38,12 +38,11 @@ export class SelectOptionsService {
getState(value:string):string{
return this.states.find(l=>l.value===value)?.name
}
getBusiness(value:string):string{
return this.typesOfBusiness.find(t=>t.value===value)?.name
getBusiness(value:number):string{
return this.typesOfBusiness.find(t=>t.value===String(value))?.name
}
getCommercialProperty(value:string):string{
return this.typesOfCommercialProperty.find(t=>t.value===value)?.name
getCommercialProperty(value:number):string{
return this.typesOfCommercialProperty.find(t=>t.value===String(value))?.name
}
getListingsCategory(value:string):string{
return this.listingCategories.find(l=>l.value===value)?.name
@@ -70,11 +69,11 @@ export class SelectOptionsService {
getTextColorType(value:string):string{
return this.typesOfBusiness.find(c=>c.value===value)?.textColorClass
}
getBgColorType(value:string):string{
return this.typesOfBusiness.find(c=>c.value===value)?.bgColorClass
getBgColorType(value:number):string{
return this.typesOfBusiness.find(c=>c.value===String(value))?.bgColorClass
}
getIconAndTextColorType(value:string):string{
const category = this.typesOfBusiness.find(c=>c.value===value)
getIconAndTextColorType(value:number):string{
const category = this.typesOfBusiness.find(c=>c.value===String(value))
return `${category?.icon} ${category?.textColorClass}`
}
}

View File

@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from '../../environments/environment';
import { HttpClient } from '@angular/common/http';
import { Subscription } from '../../../../common-models/src/main.model';
import { Subscription } from '../../../../bizmatch-server/src/models/main.model';
@Injectable({
providedIn: 'root'

View File

@@ -4,9 +4,10 @@ import { jwtDecode } from 'jwt-decode';
import { Observable, distinctUntilChanged, filter, from, lastValueFrom, map } from 'rxjs';
import { CommonModule } from '@angular/common';
import { KeycloakService } from './keycloak.service';
import { JwtToken, ListingCriteria, User } from '../../../../common-models/src/main.model';
import { environment } from '../../environments/environment';
import { HttpClient } from '@angular/common/http';
import { User } from '../../../../bizmatch-server/src/models/db.model';
import { JwtToken, ListingCriteria } from '../../../../bizmatch-server/src/models/main.model';
@Injectable({
providedIn: 'root'