json-api-query
Advanced tools
+1
-1
| { | ||
| "name": "json-api-query", | ||
| "version": "2.0.0-next.3", | ||
| "version": "2.0.0-next.4", | ||
| "description": "A query builder for JSONAPIDotNetCore", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,2 +29,7 @@ import { FindOptionsWhere } from './FindOptionsWhere' | ||
| order?: FindOptionsOrder<Entity> | ||
| /** | ||
| * Any extra params to append to the end of the qs | ||
| */ | ||
| extraParams?: string[] | ||
| } |
@@ -491,4 +491,8 @@ import { | ||
| if(this._findOptions.extraParams){ | ||
| final += this.hasQuery(final) ? `&${this._findOptions.extraParams.join('&')}` : `?${this._findOptions.extraParams.join('&')}` | ||
| } | ||
| return final | ||
| } | ||
| } |
+0
-2
@@ -21,4 +21,2 @@ import { SparseField } from './SparseField' | ||
| case 'desc': | ||
| this.fields.push(`-${field}`) | ||
| break | ||
| case 'DESC': | ||
@@ -25,0 +23,0 @@ this.fields.push(`-${field}`) |
+5
-3
@@ -1,2 +0,2 @@ | ||
| import { SortField } from './SortField' | ||
| import {SortField} from './SortField' | ||
@@ -15,4 +15,6 @@ export class Sorts { | ||
| if (find !== null && find.length > 0) { | ||
| field.fields.forEach((x) => find[0].addField(x, 'desc')) | ||
| // find[0].addFields(field.fields); | ||
| field.fields.forEach((x) => | ||
| find[0].addField(x, 'desc') | ||
| ) | ||
| return this | ||
@@ -19,0 +21,0 @@ } |
@@ -233,2 +233,29 @@ import { suite, test, should, expect, chai, timeout } from './utility' | ||
| @test 'extra params - works 1'() { | ||
| let result = this.sut | ||
| .find({ | ||
| extraParams:[ | ||
| 'test[1]=true', | ||
| ] | ||
| }) | ||
| .build() | ||
| expect(result).to.equal("?test[1]=true") | ||
| } | ||
| @test 'extra params - works 2'() { | ||
| let result = this.sut | ||
| .find({ | ||
| extraParams:[ | ||
| 'test[1]=true', | ||
| 'test[2]=false', | ||
| ] | ||
| }) | ||
| .build() | ||
| expect(result).to.equal("?test[1]=true&test[2]=false") | ||
| } | ||
| @test 'find - or implicit'() { | ||
@@ -235,0 +262,0 @@ let result = this.sut |
108492
0.73%3085
0.88%