Umstellung postgres 2. part
This commit is contained in:
@@ -4,6 +4,7 @@ import { convertStringToNullUndefined } from '../utils.js';
|
||||
import { ListingsService } from './listings.service.js';
|
||||
import { WINSTON_MODULE_PROVIDER } from 'nest-winston';
|
||||
import { Logger } from 'winston';
|
||||
import { businesses_json, commercials_json } from '../drizzle/schema.js';
|
||||
|
||||
@Controller('listings/undefined')
|
||||
export class UnknownListingsController {
|
||||
@@ -11,19 +12,15 @@ 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.findById(id,businesses_json);
|
||||
if (result){
|
||||
return result
|
||||
} else {
|
||||
return await this.listingsService.findById(id,commercials_json);
|
||||
}
|
||||
}
|
||||
|
||||
// @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);
|
||||
// }
|
||||
// }
|
||||
// @Get('repo/:repo')
|
||||
// async getAllByRepo(@Param('repo') repo:string): Promise<any> {
|
||||
// return await this.listingsService.getIdsForRepo(repo);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user