projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
17782: Fixes almost all tests (4 left) mostly by fixing namespace-type imports.
[arvados-workbench2.git]
/
src
/
services
/
api
/
order-builder.ts
diff --git
a/src/services/api/order-builder.ts
b/src/services/api/order-builder.ts
index a54836702f88cc8624b5154124e86cdf39819341..a624605fda2a21d6357270cca3d32eabbf7d3d02 100644
(file)
--- a/
src/services/api/order-builder.ts
+++ b/
src/services/api/order-builder.ts
@@
-2,17
+2,17
@@
//
// SPDX-License-Identifier: AGPL-3.0
//
// SPDX-License-Identifier: AGPL-3.0
-import
* as _
from "lodash";
-import { Resource
Types
} from "src/models/resource";
+import
{ snakeCase }
from "lodash";
+import { Resource } from "src/models/resource";
export enum OrderDirection { ASC, DESC }
export enum OrderDirection { ASC, DESC }
-export class OrderBuilder<T extends Resource
Types = ResourceTypes
> {
+export class OrderBuilder<T extends Resource
= Resource
> {
constructor(private order: string[] = []) {}
addOrder(direction: OrderDirection, attribute: keyof T, prefix?: string) {
constructor(private order: string[] = []) {}
addOrder(direction: OrderDirection, attribute: keyof T, prefix?: string) {
- this.order.push(`${prefix ? prefix + "." : ""}${
_.
snakeCase(attribute.toString())} ${direction === OrderDirection.ASC ? "asc" : "desc"}`);
+ this.order.push(`${prefix ? prefix + "." : ""}${snakeCase(attribute.toString())} ${direction === OrderDirection.ASC ? "asc" : "desc"}`);
return this;
}
return this;
}