File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export type SortDir = "asc" | "desc"
3131export type SortScope = Record < string , SortDir >
3232export type FieldScope = Record < string , string [ ] >
3333export type FieldArg = FieldScope | string [ ]
34- export type WhereClause = Record < string , string | number | boolean >
34+ export type WhereClause = Record < string , string | number | boolean | string [ ] | number [ ] >
3535export type StatsScope = Record < string , string | string [ ] >
3636export type IncludeScope = string | IncludeArgHash | ( string | IncludeArgHash ) [ ]
3737
Original file line number Diff line number Diff line change @@ -272,6 +272,23 @@ describe("Model finders", () => {
272272 expect ( data [ 0 ] ) . to . have . property ( "id" , "2" )
273273 } )
274274
275+ describe ( "when value is an array" , ( ) => {
276+ beforeEach ( ( ) => {
277+ fetchMock . reset ( )
278+ fetchMock . get (
279+ "http://example.com/api/v1/people?filter[id]=1,2,3" ,
280+ {
281+ data : [ { id : "2" , type : "people" } ]
282+ }
283+ )
284+ } )
285+
286+ it ( 'converts to comma-delimited string' , async ( ) => {
287+ const { data } = await Person . where ( { id : [ 1 , 2 , 3 ] } ) . all ( )
288+ expect ( data . length ) . to . eq ( 1 )
289+ } )
290+ } )
291+
275292 describe ( "when value is false" , ( ) => {
276293 beforeEach ( ( ) => {
277294 fetchMock . reset ( )
You can’t perform that action at this time.
0 commit comments