BugFixes image upload, image display, new DB structure for areasServed, licenedIn
This commit is contained in:
@@ -1,27 +1,23 @@
|
||||
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 { Controller, Get, Inject, Param } from '@nestjs/common';
|
||||
import { WINSTON_MODULE_PROVIDER } from 'nest-winston';
|
||||
import { Logger } from 'winston';
|
||||
import { businesses, commercials } from 'src/drizzle/schema.js';
|
||||
|
||||
import { businesses, commercials } from '../drizzle/schema.js';
|
||||
import { ListingsService } from './listings.service.js';
|
||||
|
||||
@Controller('listings/undefined')
|
||||
export class UnknownListingsController {
|
||||
|
||||
constructor(private readonly listingsService:ListingsService,@Inject(WINSTON_MODULE_PROVIDER) private readonly logger: Logger) {
|
||||
}
|
||||
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);
|
||||
if (result){
|
||||
return result
|
||||
async findById(@Param('id') id: string): Promise<any> {
|
||||
const result = await this.listingsService.findById(id, businesses);
|
||||
if (result) {
|
||||
return result;
|
||||
} else {
|
||||
return await this.listingsService.findById(id,commercials);
|
||||
return await this.listingsService.findById(id, commercials);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user