Skip to content

Commit

Permalink
Merge pull request #373 from steemit/add-device-search
Browse files Browse the repository at this point in the history
Add device search
  • Loading branch information
gl2748 authored Jun 20, 2018
2 parents 3a6c03c + d642ddb commit bec397a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions routes/adminHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ async function listSignups(req) {
}),
});
break;
case 'fingerprint.device':
andList.push({
fingerprint: where(
literal("fingerprint -> '$.device'"),
{ [nRegexp]: value }
),
});
break;
case 'fingerprint.device.vendor':
andList.push({
fingerprint: where(
Expand Down
9 changes: 9 additions & 0 deletions routes/adminHandlers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ describe('adminHandlers listSignups', () => {
name: 'fingerprint.device.renderer',
value: 'fingerprint_renderer_test',
},
{
name: 'fingerprint.device',
value: 'fingerprint_device_test',
},
],
},
});
Expand Down Expand Up @@ -139,5 +143,10 @@ describe('adminHandlers listSignups', () => {
comparator: '=',
logic: { [regexp]: 'fingerprint_renderer_test' },
});
expect(q[18].fingerprint).toEqual({
attribute: { val: "fingerprint -> '$.device'" },
comparator: '=',
logic: { [regexp]: 'fingerprint_device_test' },
});
});
});

0 comments on commit bec397a

Please sign in to comment.