Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then((person: PersonEntry) => {
const username = person.entry.id;
const filterQueries = [
{ query: `cm:modified:[NOW/DAY-30DAYS TO NOW/DAY+1DAY]` },
{ query: `cm:modifier:${username} OR cm:creator:${username}` },
{ query: defaultFilter.join(' AND ') }
];
if (filters && filters.length > 0) {
filterQueries.push({
query: filters.join()
});
}
const query: SearchRequest = new SearchRequest({
query: {
query: '*',
language: 'afts'
},
filterQueries,
include: ['path', 'properties', 'allowableOperations'],
sort: [{
type: 'FIELD',
field: 'cm:modified',
ascending: false
}],
paging: {
maxItems: pagination.maxItems,
skipCount: pagination.skipCount
}
});