Disable resourcePrefix snakecase in FilterBuilder - it was making it impossible to...
[arvados-workbench2.git] / src / services / api / filter-builder.ts
index 06a040e3cc373f8206c83783c90e8cdf010d095a..f83f574faf007fa948442cf32710c15c17cd9750 100644 (file)
@@ -31,6 +31,22 @@ export class FilterBuilder {
         return this.addCondition(field, "in", value, "", "", resourcePrefix);
     }
 
+    public addGt(field: string, value?: string, resourcePrefix?: string) {
+        return this.addCondition(field, ">", value, "", "", resourcePrefix);
+    }
+
+    public addGte(field: string, value?: string, resourcePrefix?: string) {
+        return this.addCondition(field, ">=", value, "", "", resourcePrefix);
+    }
+
+    public addLt(field: string, value?: string, resourcePrefix?: string) {
+        return this.addCondition(field, "<", value, "", "", resourcePrefix);
+    }
+
+    public addLte(field: string, value?: string, resourcePrefix?: string) {
+        return this.addCondition(field, "<=", value, "", "", resourcePrefix);
+    }
+
     public getFilters() {
         return this.filters;
     }
@@ -46,7 +62,7 @@ export class FilterBuilder {
             }
 
             const resPrefix = resourcePrefix
-                ? _.snakeCase(resourcePrefix) + "."
+                ? resourcePrefix + "."
                 : "";
 
             this.filters += `${this.filters ? "," : ""}["${resPrefix}${_.snakeCase(field)}","${cond}",${value}]`;