mirror of
https://github.com/typicode/json-server.git
synced 2025-08-03 04:12:22 +08:00
Fix for multiple _ne operators (#1013)
When filtering with multiple _ne it should use logical AND instead of OR to verify that all checks succeed, close #929
This commit is contained in:
@ -348,6 +348,13 @@ describe('Server', () => {
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(db.comments.slice(1))
|
||||
.expect(200))
|
||||
|
||||
test('should accept multiple parameters', () =>
|
||||
request(server)
|
||||
.get('/comments?id_ne=1&id_ne=2')
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(db.comments.slice(2))
|
||||
.expect(200))
|
||||
})
|
||||
|
||||
describe('GET /:resource?attr_like=', () => {
|
||||
@ -357,6 +364,12 @@ describe('Server', () => {
|
||||
.expect('Content-Type', /json/)
|
||||
.expect([db.tags[1], db.tags[2]])
|
||||
.expect(200))
|
||||
test('should accept multiple parameters', () =>
|
||||
request(server)
|
||||
.get('/tags?body_like=photo&body_like=tech')
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(db.tags)
|
||||
.expect(200))
|
||||
})
|
||||
|
||||
describe('GET /:parent/:parentId/:resource', () => {
|
||||
|
Reference in New Issue
Block a user