17782: Fixes almost all tests (4 left) mostly by fixing namespace-type imports.
[arvados-workbench2.git] / src / services / api / order-builder.ts
index a54836702f88cc8624b5154124e86cdf39819341..a624605fda2a21d6357270cca3d32eabbf7d3d02 100644 (file)
@@ -2,17 +2,17 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as _ from "lodash";
-import { ResourceTypes } from "src/models/resource";
+import { snakeCase } from "lodash";
+import { Resource } from "src/models/resource";
 
 export enum OrderDirection { ASC, DESC }
 
-export class OrderBuilder<T extends ResourceTypes = ResourceTypes> {
+export class OrderBuilder<T extends Resource = Resource> {
 
     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;
     }