We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 80d853f commit 205aaa3Copy full SHA for 205aaa3
src/loader/cleanup-entries.ts
@@ -32,9 +32,21 @@ export async function cleanupEntries(
32
33
// Fetch all ids of the collection
34
do {
35
+ // Build search parameters
36
+ const searchParams = new URLSearchParams({
37
+ page: `${++page}`,
38
+ perPage: "1000",
39
+ fields: "id"
40
+ });
41
+
42
+ if (options.filter) {
43
+ // If a filter is set, add it to the search parameters
44
+ searchParams.set("filter", `(${options.filter})`);
45
+ }
46
47
// Fetch ids from the collection
48
const collectionRequest = await fetch(
- `${collectionUrl}?page=${++page}&perPage=1000&fields=id`,
49
+ `${collectionUrl}?${searchParams.toString()}`,
50
{
51
headers: collectionHeaders
52
}
0 commit comments