Issues #47,#42, #35 resolved, request logging erweitert

This commit is contained in:
2024-05-24 18:15:33 -05:00
parent c9d94e973a
commit 0473f74241
7 changed files with 32 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
import { Inject, Injectable } from '@nestjs/common';
import { and, eq, gte, ilike, lte, sql } from 'drizzle-orm';
import { and, eq, gte, ilike, lte, ne, sql } from 'drizzle-orm';
import { NodePgDatabase } from 'drizzle-orm/node-postgres';
import { WINSTON_MODULE_PROVIDER } from 'nest-winston';
import { BusinessListing, CommercialPropertyListing } from 'src/models/db.model.js';
@@ -18,6 +18,7 @@ export class ListingsService {
) {}
private getConditions(criteria: ListingCriteria, table: typeof businesses | typeof commercials): any[] {
const conditions = [];
conditions.push(ne(table.draft, true));
if (criteria.type) {
conditions.push(eq(table.type, criteria.type));
}