filters implemented

This commit is contained in:
Simon Larsen 2022-07-29 20:20:47 +01:00
parent c36754b662
commit 57f96241f1
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
4 changed files with 4 additions and 1 deletions

View File

@ -183,6 +183,7 @@ export default class BaseAPI<
query = JSONFunctions.deserialize(
req.body['query']
) as Query<BaseModel>;
debugger;
select = JSONFunctions.deserialize(
req.body['select']
) as Select<BaseModel>;

View File

@ -868,6 +868,7 @@ class DatabaseService<TBaseModel extends BaseModel> {
(query[key] as ObjectID).toString() as any
) as any;
} else if (query[key] && query[key] instanceof Search) {
debugger;
query[key] = QueryHelper.search(
(query[key] as Search).toString() as any
) as any;

View File

@ -21,7 +21,7 @@ export default class QueryHelper {
const rid: string = Text.generateRandomText(10);
return Raw(
(alias: string) => {
return `LOWER(${alias}) = :${rid}`;
return `LOWER(${alias}) LIKE (:${rid})`;
},
{
[rid]: `%${name}%`,

View File

@ -22,6 +22,7 @@ import LocalCache from '../Infrastructure/LocalCache';
import Exception from 'Common/Types/Exception/Exception';
import ObjectID from 'Common/Types/ObjectID';
import StatusCode from 'Common/Types/API/StatusCode';
import Typeof from 'Common/Types/Typeof';
// import OpenTelemetrySDK from "./OpenTelemetry";
const app: ExpressApplication = Express.getExpressApp();