adminforth 1.3.18 → 1.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,10 @@ import { error } from 'console';
|
|
|
2
2
|
import { IAdminForthFilter, IAdminForthSort, IOperationalResource, IAdminForthDataSourceConnectorBase, AdminForthResource, IAdminForth } from '../types/AdminForthConfig.js';
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
function filtersIfFilter(filter: IAdminForthFilter | IAdminForthFilter[]): IAdminForthFilter[] {
|
|
5
|
+
function filtersIfFilter(filter: IAdminForthFilter | IAdminForthFilter[] | undefined): IAdminForthFilter[] {
|
|
6
|
+
if (!filter) {
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
6
9
|
return (Array.isArray(filter) ? filter : [filter]) as IAdminForthFilter[];
|
|
7
10
|
}
|
|
8
11
|
|
|
@@ -57,7 +60,7 @@ export default class OperationalResource implements IOperationalResource {
|
|
|
57
60
|
return data;
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
async count(filter: IAdminForthFilter | IAdminForthFilter[]): Promise<number> {
|
|
63
|
+
async count(filter: IAdminForthFilter | IAdminForthFilter[] | undefined): Promise<number> {
|
|
61
64
|
return await this.dataConnector.getCount({
|
|
62
65
|
resource: this.resourceConfig,
|
|
63
66
|
filters: filtersIfFilter(filter),
|