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:
Filippo Conti
2019-09-02 18:30:35 +02:00
committed by typicode
parent 4f315b090f
commit ae1428375d
2 changed files with 19 additions and 5 deletions

View File

@ -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', () => {