Skip to content

Commit 6b35360

Browse files
committed
Fixed: #229
1 parent 2c9da74 commit 6b35360

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

β€Žmock/rule.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@ export function getRule(req, res, u) {
4141
}
4242

4343
if (params.status) {
44-
const s = params.status.split(',');
45-
if (s.length === 1) {
46-
dataSource = dataSource.filter(data => parseInt(data.status, 10) === parseInt(s[0], 10));
47-
}
44+
const status = params.status.split(',');
45+
let filterDataSource = [];
46+
status.forEach((s) => {
47+
filterDataSource = filterDataSource.concat(
48+
[...dataSource].filter(data => parseInt(data.status, 10) === parseInt(s[0], 10))
49+
);
50+
});
51+
dataSource = filterDataSource;
4852
}
4953

5054
if (params.no) {

0 commit comments

Comments
Β (0)