fix inputnumber, Umbau auf redis-om, Neubenamung
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
"on-change": "^5.0.1",
|
||||
"primeflex": "^3.3.1",
|
||||
"primeicons": "^6.0.1",
|
||||
"primeng": "^17.6.0",
|
||||
"primeng": "^17.10.0",
|
||||
"rxjs": "~7.8.1",
|
||||
"tslib": "^2.3.0",
|
||||
"urlcat": "^3.1.0",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { APP_INITIALIZER, ApplicationConfig, importProvidersFrom } from '@angular/core';
|
||||
import { APP_INITIALIZER, ApplicationConfig, LOCALE_ID, importProvidersFrom } from '@angular/core';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
import { routes } from './app.routes';
|
||||
@@ -26,7 +26,8 @@ export const appConfig: ApplicationConfig = {
|
||||
multi: true,
|
||||
deps: [SelectOptionsService],
|
||||
},
|
||||
provideRouter(routes),provideAnimations()
|
||||
provideRouter(routes),provideAnimations(),
|
||||
// {provide: LOCALE_ID, useValue: 'en-US' }
|
||||
]
|
||||
};
|
||||
function initUserService(userService:UserService) {
|
||||
|
||||
@@ -45,8 +45,8 @@ export class HeaderComponent {
|
||||
fragment:''
|
||||
},
|
||||
{
|
||||
label: 'Investment Property',
|
||||
routerLink: '/listings/investment',
|
||||
label: 'Commercial Property',
|
||||
routerLink: '/listings/commercialProperty',
|
||||
fragment:''
|
||||
}
|
||||
];
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
// @layer primeng {
|
||||
app-inputnumber,
|
||||
.p-inputnumber {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.p-inputnumber-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button .p-button-label,
|
||||
.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button .p-button-label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-up {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.p-inputnumber-buttons-stacked .p-inputnumber-input {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-down {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.p-inputnumber-buttons-stacked .p-inputnumber-button-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up {
|
||||
order: 3;
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
.p-inputnumber-buttons-horizontal .p-inputnumber-input {
|
||||
order: 2;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down {
|
||||
order: 1;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
.p-inputnumber-buttons-vertical {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up {
|
||||
order: 1;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.p-inputnumber-buttons-vertical .p-inputnumber-input {
|
||||
order: 2;
|
||||
border-radius: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down {
|
||||
order: 3;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.p-inputnumber-input {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.p-fluid app-inputnumber,
|
||||
.p-fluid .p-inputnumber {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.p-fluid .p-inputnumber .p-inputnumber-input {
|
||||
width: 1%;
|
||||
}
|
||||
|
||||
.p-fluid .p-inputnumber-buttons-vertical .p-inputnumber-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.p-inputnumber-clear-icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -0.5rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.p-inputnumber-clearable {
|
||||
position: relative;
|
||||
}
|
||||
// }
|
||||
1480
bizmatch/src/app/components/inputnumber/inputnumber.component.ts
Normal file
1480
bizmatch/src/app/components/inputnumber/inputnumber.component.ts
Normal file
File diff suppressed because it is too large
Load Diff
@@ -85,7 +85,7 @@
|
||||
<div class="text-900 w-full md:w-10">{{listing.category}}</div>
|
||||
</li>
|
||||
} -->
|
||||
@if (listing && (listing.listingsCategory==='investment')){
|
||||
@if (listing && (listing.listingsCategory==='commercialProperty')){
|
||||
<li class="flex align-items-center py-3 px-2 flex-wrap surface-ground">
|
||||
<div class="text-500 w-full md:w-2 font-medium">Located in</div>
|
||||
<div class="text-900 w-full md:w-10">{{selectOptions.getState(listing.state)}}</div>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<div
|
||||
class="align-items-center flex-grow-1 justify-content-between hidden lg:flex absolute lg:static w-full left-0 top-100 px-6 lg:px-0 shadow-2 lg:shadow-none z-2">
|
||||
<section></section>
|
||||
<ul
|
||||
<!-- <ul
|
||||
class="list-none p-0 m-0 flex lg:align-items-center text-blue-900 select-none flex-column lg:flex-row cursor-pointer">
|
||||
<li>
|
||||
<a pRipple
|
||||
@@ -25,7 +25,7 @@
|
||||
<span>Pricing</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul> -->
|
||||
<div
|
||||
class="flex justify-content-between lg:block border-top-1 lg:border-top-none border-gray-800 py-3 lg:py-0 mt-3 lg:mt-0">
|
||||
<!-- <p-button label="Account" class="ml-3 font-bold" [outlined]="true" severity="secondary" [routerLink]="['/account']"></p-button> -->
|
||||
@@ -63,9 +63,9 @@
|
||||
<li><button pButton pRipple icon="pi pi-globe" (click)="activeTabAction = 'professionals_brokers'"
|
||||
label="Professionals/Brokers Directory"
|
||||
[ngClass]="{'p-button-text text-700': activeTabAction != 'professionals_brokers'}"></button></li>
|
||||
<li><button pButton pRipple icon="pi pi-shield" (click)="activeTabAction = 'investment'"
|
||||
label="Investment Property"
|
||||
[ngClass]="{'p-button-text text-700': activeTabAction != 'investment'}"></button>
|
||||
<li><button pButton pRipple icon="pi pi-shield" (click)="activeTabAction = 'commercialProperty'"
|
||||
label="Commercial Property"
|
||||
[ngClass]="{'p-button-text text-700': activeTabAction != 'commercialProperty'}"></button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -29,24 +29,24 @@
|
||||
offLabel="Real Estate included"></p-toggleButton>
|
||||
</div>
|
||||
}
|
||||
@if (listingCategory==='investment'){
|
||||
@if (listingCategory==='commercialProperty'){
|
||||
<div class="col-2">
|
||||
<p-dropdown [options]="states" [(ngModel)]="criteria.location" optionLabel="name" optionValue="value"
|
||||
<p-dropdown [options]="states" [(ngModel)]="criteria.state" optionLabel="name" optionValue="value"
|
||||
[showClear]="true" placeholder="Location" [style]="{ width: '100%'}"></p-dropdown>
|
||||
</div>
|
||||
}
|
||||
@if (listingCategory==='professionals_brokers'){
|
||||
<div class="col-2">
|
||||
<!-- @if (listingCategory==='professionals_brokers'){ -->
|
||||
<!-- <div class="col-2">
|
||||
<p-dropdown [options]="selectOptions.categories" [(ngModel)]="criteria.category" optionLabel="name"
|
||||
optionValue="value" [showClear]="true" placeholder="Category"
|
||||
[style]="{ width: '100%'}"></p-dropdown>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<p-dropdown [options]="states" [(ngModel)]="criteria.location" optionLabel="name" optionValue="value"
|
||||
<p-dropdown [options]="states" [(ngModel)]="criteria.state" optionLabel="name" optionValue="value"
|
||||
[showClear]="true" placeholder="Location" [style]="{ width: '100%'}"></p-dropdown>
|
||||
</div>
|
||||
}
|
||||
<div [ngClass]="{'col-offset-9':type==='investment','col-offset-7':type==='professionals_brokers'}" class="col-1">
|
||||
</div> -->
|
||||
<!-- } -->
|
||||
<div [ngClass]="{'col-offset-9':type==='commercialProperty','col-offset-7':type==='professionals_brokers'}" class="col-1">
|
||||
<p-button label="Refine" (click)="search()"></p-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -70,24 +70,15 @@
|
||||
<span class="text-900 font-medium text-2xl">{{selectOptions.getBusiness(listing.type)}}</span>
|
||||
</div>
|
||||
}
|
||||
@if (listing.listingsCategory==='professionals_brokers'){
|
||||
<div class="flex align-items-center">
|
||||
<span [class]="selectOptions.getBgColor(listing.category)" class="inline-flex border-circle align-items-center justify-content-center mr-3"
|
||||
style="width:38px;height:38px">
|
||||
<i [class]="selectOptions.getIconAndTextColor(listing.category)" class="text-xl"></i>
|
||||
</span>
|
||||
<span class="text-900 font-medium text-2xl">{{selectOptions.getCategory(listing.category)}}</span>
|
||||
</div>
|
||||
}
|
||||
@if (listing.listingsCategory==='investment'){
|
||||
<div class="flex align-items-center">
|
||||
@if (listing.listingsCategory==='commercialProperty'){
|
||||
<!-- <div class="flex align-items-center">
|
||||
<span
|
||||
class="inline-flex border-circle align-items-center justify-content-center bg-green-100 mr-3"
|
||||
style="width:38px;height:38px">
|
||||
<i class="pi pi-globe text-xl text-green-600"></i>
|
||||
</span>
|
||||
<span class="text-900 font-medium text-2xl">Investment</span>
|
||||
</div>
|
||||
</div> -->
|
||||
}
|
||||
<div class="text-900 my-3 text-xl font-medium">{{listing.title}}</div>
|
||||
@if (listing.listingsCategory==='business'){
|
||||
@@ -97,17 +88,11 @@
|
||||
<p class="mt-0 mb-1 text-700 line-height-3">Location: {{selectOptions.getState(listing.state)}}</p>
|
||||
<p class="mt-0 mb-1 text-700 line-height-3">Established: {{listing.established}}</p>
|
||||
}
|
||||
@if (listing.listingsCategory==='professionals_brokers'){
|
||||
<!-- <p class="mt-0 mb-1 text-700 line-height-3">Category: {{listing.category}}</p> -->
|
||||
<p class="mt-0 mb-1 text-700 line-height-3">Location: {{selectOptions.getState(listing.state)}}</p>
|
||||
@if (listing.listingsCategory==='commercialProperty'){
|
||||
<!-- <p class="mt-0 mb-1 text-700 line-height-3">Location: {{selectOptions.getState(listing.state)}}</p>
|
||||
<p class="mt-0 mb-1 text-700 line-height-3">EMail: {{listing.email}}</p>
|
||||
<p class="mt-0 mb-1 text-700 line-height-3">Website: {{listing.website}}</p>
|
||||
}
|
||||
@if (listing.listingsCategory==='investment'){
|
||||
<p class="mt-0 mb-1 text-700 line-height-3">Location: {{selectOptions.getState(listing.state)}}</p>
|
||||
<p class="mt-0 mb-1 text-700 line-height-3">EMail: {{listing.email}}</p>
|
||||
<p class="mt-0 mb-1 text-700 line-height-3">Website: {{listing.website}}</p>
|
||||
<p class="mt-0 mb-1 text-700 line-height-3">Phone Number: {{listing.phoneNumber}}</p>
|
||||
<p class="mt-0 mb-1 text-700 line-height-3">Phone Number: {{listing.phoneNumber}}</p> -->
|
||||
}
|
||||
<div class="mt-auto ml-auto">
|
||||
<img *ngIf="!listing.hideImage" src="{{environment.apiBaseUrl}}/profile_{{listing.userId}}" (error)="imageErrorHandler(listing)" class="rounded-image"/>
|
||||
|
||||
@@ -40,7 +40,7 @@ export class ListingsComponent {
|
||||
first: number = 0;
|
||||
rows: number = 12;
|
||||
totalRecords:number = 0;
|
||||
public listingCategory: 'business' | 'professionals_brokers' | 'investment' | undefined;
|
||||
public listingCategory: 'business' | 'commercialProperty' | undefined;
|
||||
|
||||
constructor(public selectOptions: SelectOptionsService, private listingsService:ListingsService,private activatedRoute: ActivatedRoute, private router:Router, private cdRef:ChangeDetectorRef) {
|
||||
this.criteria = onChange(getCriteriaStateObject(),getSessionStorageHandler);
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<p-autoComplete [(ngModel)]="listing.city" [suggestions]="suggestions" (completeMethod)="search($event)"></p-autoComplete>
|
||||
</div>
|
||||
</div>
|
||||
<!-- @if (listing.listingsCategory==='investment'){
|
||||
<!-- @if (listing.listingsCategory==='commercialProperty'){
|
||||
<div>
|
||||
<div class="mb-4">
|
||||
<label for="email" class="block font-medium text-900 mb-2">Email</label>
|
||||
@@ -76,28 +76,29 @@
|
||||
<div class="grid">
|
||||
<div class="mb-4 col-12 md:col-6">
|
||||
<label for="price" class="block font-medium text-900 mb-2">Price</label>
|
||||
<p-inputNumber mode="currency" currency="USD" inputId="price" type="text" [(ngModel)]="listing.price"></p-inputNumber>
|
||||
<!-- <p-inputNumber mode="currency" currency="USD" locale="en-US" inputId="price" [(ngModel)]="listing.price" ></p-inputNumber> -->
|
||||
<app-inputNumber mode="currency" currency="USD" locale="en-US" inputId="price" [(ngModel)]="listing.price"></app-inputNumber>
|
||||
</div>
|
||||
<div class="mb-4 col-12 md:col-6">
|
||||
<label for="salesRevenue" class="block font-medium text-900 mb-2">Sales Revenue</label>
|
||||
<p-inputNumber mode="currency" currency="USD" inputId="salesRevenue" type="text" [(ngModel)]="listing.salesRevenue"></p-inputNumber>
|
||||
<app-inputNumber mode="currency" currency="USD" inputId="salesRevenue" [(ngModel)]="listing.salesRevenue"></app-inputNumber>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid">
|
||||
<div class="mb-4 col-12 md:col-6">
|
||||
<label for="cashFlow" class="block font-medium text-900 mb-2">Cash Flow</label>
|
||||
<p-inputNumber mode="currency" currency="USD" inputId="cashFlow" type="text" [(ngModel)]="listing.cashFlow"></p-inputNumber>
|
||||
<app-inputNumber mode="currency" currency="USD" inputId="cashFlow" [(ngModel)]="listing.cashFlow"></app-inputNumber>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="grid">
|
||||
<div class="mb-4 col-12 md:col-6">
|
||||
<label for="employees" class="block font-medium text-900 mb-2">Years Established Since</label>
|
||||
<p-inputNumber mode="employees" mode="decimal" inputId="employees" type="text" [(ngModel)]="listing.established"></p-inputNumber>
|
||||
<app-inputNumber mode="decimal" inputId="established" [(ngModel)]="listing.established"></app-inputNumber>
|
||||
</div>
|
||||
<div class="mb-4 col-12 md:col-6">
|
||||
<label for="employees" class="block font-medium text-900 mb-2">Employees</label>
|
||||
<p-inputNumber mode="employees" mode="decimal" inputId="employees" type="text" [(ngModel)]="listing.employees"></p-inputNumber>
|
||||
<app-inputNumber mode="decimal" inputId="employees" [(ngModel)]="listing.employees"></app-inputNumber>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid">
|
||||
@@ -130,7 +131,7 @@
|
||||
</div>
|
||||
<div class="mb-4 col-12 md:col-6">
|
||||
<label for="internalListingNumber" class="block font-medium text-900 mb-2">Internal Listing Number</label>
|
||||
<p-inputNumber mode="decimal" inputId="internalListingNumber" type="text" [(ngModel)]="listing.internalListingNumber"></p-inputNumber>
|
||||
<app-inputNumber mode="decimal" inputId="internalListingNumber" type="text" [(ngModel)]="listing.internalListingNumber"></app-inputNumber>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
@@ -149,9 +150,9 @@
|
||||
}
|
||||
<div>
|
||||
@if (mode==='create'){
|
||||
<button pButton pRipple label="Post Listing" class="w-auto" (click)="create()"></button>
|
||||
<button pButton pRipple label="Post Listing" class="w-auto" (click)="save()"></button>
|
||||
} @else {
|
||||
<button pButton pRipple label="Update Listing" class="w-auto" (click)="update(listing.id)"></button>
|
||||
<button pButton pRipple label="Update Listing" class="w-auto" (click)="save()"></button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -20,26 +20,27 @@ import { TableModule } from 'primeng/table';
|
||||
import { createGenericObject } from '../../../utils/utils';
|
||||
import { ListingsService } from '../../../services/listings.service';
|
||||
import { lastValueFrom } from 'rxjs';
|
||||
import { InputNumberModule } from 'primeng/inputnumber';
|
||||
|
||||
import { ArrayToStringPipe } from '../../../pipes/array-to-string.pipe';
|
||||
import { UserService } from '../../../services/user.service';
|
||||
import { SharedModule } from '../../../shared/shared/shared.module';
|
||||
import { MessageService } from 'primeng/api';
|
||||
import { AutoCompleteCompleteEvent, BusinessListing, ListingType, User } from '../../../../../../common-models/src/main.model';
|
||||
import { GeoResult, GeoService } from '../../../services/geo.service';
|
||||
import { InputNumberComponent, InputNumberModule } from '../../../components/inputnumber/inputnumber.component';
|
||||
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'create-listing',
|
||||
standalone: true,
|
||||
imports: [SharedModule,ArrayToStringPipe],
|
||||
imports: [SharedModule,ArrayToStringPipe, InputNumberModule],
|
||||
providers:[MessageService],
|
||||
templateUrl: './edit-listing.component.html',
|
||||
styleUrl: './edit-listing.component.scss'
|
||||
})
|
||||
export class EditListingComponent {
|
||||
listingCategory:'Business'|'Professionals/Brokers Directory'|'Investment Property';
|
||||
listingCategory:'Business'|'Commercial Property';
|
||||
category:string;
|
||||
location:string;
|
||||
mode:'edit'|'create';
|
||||
@@ -47,6 +48,7 @@ export class EditListingComponent {
|
||||
listing:ListingType = createGenericObject<BusinessListing>();
|
||||
private id: string | undefined = this.activatedRoute.snapshot.params['id'] as string | undefined;
|
||||
user:User;
|
||||
value:12;
|
||||
constructor(public selectOptions:SelectOptionsService,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
@@ -66,6 +68,7 @@ export class EditListingComponent {
|
||||
async ngOnInit(){
|
||||
if (this.mode==='edit'){
|
||||
this.listing=await lastValueFrom(this.listingsService.getListingById(this.id));
|
||||
this.listing.price=123456
|
||||
} else {
|
||||
this.listing=createGenericObject<BusinessListing>();
|
||||
this.listing.userId=this.user.id
|
||||
@@ -76,19 +79,19 @@ export class EditListingComponent {
|
||||
// const lines = value.split('\n');
|
||||
// (<BusinessListing>this.listing).summary = lines.filter(l=>l.trim().length>0);
|
||||
// }
|
||||
async update(id:string){
|
||||
await this.listingsService.update(this.listing,this.listing.id);
|
||||
this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Listing has been updated', life: 3000 });
|
||||
}
|
||||
async create(){
|
||||
await this.listingsService.create(this.listing);
|
||||
this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Listing has been created', life: 3000 });
|
||||
// async update(id:string){
|
||||
// await this.listingsService.update(this.listing,this.listing.id);
|
||||
// this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Listing has been updated', life: 3000 });
|
||||
// }
|
||||
async save(){
|
||||
await this.listingsService.save(this.listing);
|
||||
this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Listing changes have been persisted', life: 3000 });
|
||||
}
|
||||
|
||||
suggestions: string[] | undefined;
|
||||
|
||||
async search(event: AutoCompleteCompleteEvent) {
|
||||
const result = await lastValueFrom(this.geoService.findCitiesStartingWith(event.query,this.listing.state))//[...Array(5).keys()].map(item => event.query + '-' + item);
|
||||
const result = await lastValueFrom(this.geoService.findCitiesStartingWith(event.query,this.listing.state))
|
||||
this.suggestions = result.map(r=>r.city).slice(0,5);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,22 +12,22 @@ export class ListingsService {
|
||||
constructor(private http: HttpClient) { }
|
||||
|
||||
getAllListings():Observable<BusinessListing[]>{
|
||||
return this.http.get<BusinessListing[]>(`${this.apiBaseUrl}/bizmatch/listings`);
|
||||
return this.http.get<BusinessListing[]>(`${this.apiBaseUrl}/bizmatch/business-listings`);
|
||||
}
|
||||
async getListings(criteria:ListingCriteria):Promise<BusinessListing[]>{
|
||||
const result = await lastValueFrom(this.http.post<BusinessListing[]>(`${this.apiBaseUrl}/bizmatch/listings/search`,criteria));
|
||||
const result = await lastValueFrom(this.http.post<BusinessListing[]>(`${this.apiBaseUrl}/bizmatch/business-listings/search`,criteria));
|
||||
return result;
|
||||
}
|
||||
getListingById(id:string):Observable<BusinessListing>{
|
||||
return this.http.get<BusinessListing>(`${this.apiBaseUrl}/bizmatch/listings/${id}`);
|
||||
return this.http.get<BusinessListing>(`${this.apiBaseUrl}/bizmatch/business-listings/${id}`);
|
||||
}
|
||||
async update(listing:any,id:string){
|
||||
await lastValueFrom(this.http.put<BusinessListing>(`${this.apiBaseUrl}/bizmatch/listings/${id}`,listing));
|
||||
}
|
||||
async create(listing:any){
|
||||
await lastValueFrom(this.http.post<BusinessListing>(`${this.apiBaseUrl}/bizmatch/listings`,listing));
|
||||
// async update(listing:any,id:string){
|
||||
// await lastValueFrom(this.http.put<BusinessListing>(`${this.apiBaseUrl}/bizmatch/listings/${id}`,listing));
|
||||
// }
|
||||
async save(listing:any){
|
||||
await lastValueFrom(this.http.post<BusinessListing>(`${this.apiBaseUrl}/bizmatch/business-listings`,listing));
|
||||
}
|
||||
async deleteListing(id:string){
|
||||
await lastValueFrom(this.http.delete<BusinessListing>(`${this.apiBaseUrl}/bizmatch/listings/${id}`));
|
||||
await lastValueFrom(this.http.delete<BusinessListing>(`${this.apiBaseUrl}/bizmatch/business-listings/${id}`));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import { ConfirmPopupModule } from 'primeng/confirmpopup';
|
||||
import { ToastModule } from 'primeng/toast';
|
||||
import { AutoCompleteModule } from 'primeng/autocomplete';
|
||||
import { InputSwitchModule } from 'primeng/inputswitch';
|
||||
|
||||
@NgModule({
|
||||
declarations: [],
|
||||
imports: [
|
||||
|
||||
@@ -4,5 +4,6 @@ import { AppComponent } from './app/app.component';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
|
||||
bootstrapApplication(AppComponent, appConfig)
|
||||
.catch((err) => console.error(err));
|
||||
|
||||
Reference in New Issue
Block a user