mirror of
https://github.com/strapi/strapi.git
synced 2025-12-05 03:21:22 +00:00
Add same filter logic to file count
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
parent
ae143ef627
commit
168ceefa87
@ -268,6 +268,12 @@ module.exports = {
|
||||
},
|
||||
|
||||
count(params) {
|
||||
// FIXME: until we support boolean operators for querying we need to make mime_ncontains use AND instead of OR
|
||||
if (_.has(params, 'mime_ncontains') && Array.isArray(params.mime_ncontains)) {
|
||||
params._where = params.mime_ncontains.map(val => ({ mime_ncontains: val }));
|
||||
delete params.mime_ncontains;
|
||||
}
|
||||
|
||||
return strapi.query('file', 'upload').count(params);
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user