bizmatch-project/bizmatch-server/src/listings/unknown-listings.controller.ts

27 lines
857 B
TypeScript

import { Body, Controller, Delete, Get, Inject, Param, Post, Put } from '@nestjs/common';
import { FileService } from '../file/file.service.js';
import { convertStringToNullUndefined } from '../utils.js';
import { ListingsService } from './listings.service.js';
import { WINSTON_MODULE_PROVIDER } from 'nest-winston';
import { Logger } from 'winston';
@Controller('listings/undefined')
export class UnknownListingsController {
constructor(private readonly listingsService:ListingsService,@Inject(WINSTON_MODULE_PROVIDER) private readonly logger: Logger) {
}
@Get(':id')
async findById(@Param('id') id:string): Promise<any> {
const result = await this.listingsService.getBusinessListingById(id);
if (result.id){
return result
} else {
return await this.listingsService.getCommercialPropertyListingById(id);
}
}
}