mirror of
https://github.com/typicode/json-server.git
synced 2025-08-01 09:13:32 +08:00
@ -120,7 +120,7 @@ module.exports = (db, name) => {
|
||||
const path = key.replace(/(_lte|_gte|_ne|_like)$/, '')
|
||||
const elementValue = _.get(element, path)
|
||||
|
||||
if (!elementValue) {
|
||||
if (elementValue == null) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -194,6 +194,14 @@ describe('Server', () => {
|
||||
.expect([ db.comments[3] ])
|
||||
.expect(200, done)
|
||||
})
|
||||
|
||||
it('should support filtering by boolean value false', (done) => {
|
||||
request(server)
|
||||
.get('/comments?published=false')
|
||||
.expect('Content-Type', /json/)
|
||||
.expect([ db.comments[1], db.comments[2], db.comments[4] ])
|
||||
.expect(200, done)
|
||||
})
|
||||
})
|
||||
|
||||
describe('GET /:resource?_end=', () => {
|
||||
|
Reference in New Issue
Block a user