mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-25 13:47:55 +00:00
list space-model
This commit is contained in:
@@ -31,7 +31,7 @@ interface FindAllQueryWithDefaults extends CustomFindAllQuery {
|
||||
function getDefaultQueryOptions(
|
||||
query: Partial<TypeORMCustomModelFindAllQuery>,
|
||||
): FindManyOptions & FindAllQueryWithDefaults {
|
||||
const { page, size, includeDisable, modelName, ...rest } = query;
|
||||
const { page, size, includeDisable, include, modelName, ...rest } = query;
|
||||
|
||||
// Set default if undefined or null
|
||||
const returnPage = page ? Number(page) : 1;
|
||||
@@ -48,7 +48,9 @@ function getDefaultQueryOptions(
|
||||
},
|
||||
page: returnPage,
|
||||
size: returnSize,
|
||||
include: include || undefined,
|
||||
includeDisable: returnIncludeDisable,
|
||||
|
||||
modelName: modelName || query.modelName, // Ensure modelName is passed through
|
||||
};
|
||||
}
|
||||
@@ -97,7 +99,6 @@ export function TypeORMCustomModel(repository: Repository<any>) {
|
||||
|
||||
// Use the where clause directly, without wrapping it under 'where'
|
||||
const whereClause = buildTypeORMWhereClause({ where });
|
||||
console.log('Final where clause:', whereClause);
|
||||
|
||||
// Ensure the whereClause is passed directly to findAndCount
|
||||
const [data, count] = await repository.findAndCount({
|
||||
|
||||
Reference in New Issue
Block a user