We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c435ee commit 7ce0279Copy full SHA for 7ce0279
src/server/router/plural.js
@@ -92,6 +92,10 @@ module.exports = (db, name) => {
92
93
if (q) {
94
// Full-text search
95
+ if (Array.isArray(q)) {
96
+ q = q[0]
97
+ }
98
+
99
q = q.toLowerCase()
100
101
chain = chain.filter((obj) => {
test/server/plural.js
@@ -198,6 +198,14 @@ describe('Server', () => {
198
.expect(200, done)
199
})
200
201
+ it('should ignore duplicate q query parameters', (done) => {
202
+ request(server)
203
+ .get('/comments?q=foo&q=bar')
204
+ .expect('Content-Type', /json/)
205
+ .expect([ db.comments[0] ])
206
+ .expect(200, done)
207
+ })
208
209
it('should support filtering by boolean value false', (done) => {
210
request(server)
211
.get('/comments?published=false')
0 commit comments