Umbau auf postgres 2. step
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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>{
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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}`
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user