diff --git a/app/controllers/admin/tasks/index.js b/app/controllers/admin/tasks/index.js
index 53043e7..01ed8ef 100644
--- a/app/controllers/admin/tasks/index.js
+++ b/app/controllers/admin/tasks/index.js
@@ -10,31 +10,38 @@ export default class AdminTasksIndexController extends Controller {
taskStatuses = taskStatuses;
taskTypes = taskTypes;
- queryParams = ['limit', 'status', 'type', 'indexUid'];
+ queryParams = ['limit', 'statuses', 'types', 'indexUids'];
@tracked limit = 20;
@tracked from;
- @tracked status;
- @tracked type;
- @tracked indexUid;
+ @tracked statuses;
+ @tracked types;
+ @tracked indexUids;
@use
- tasks = resource(() => {
+ tasks = resource(({ on }) => {
this.tasksHolder.isLoading = true;
+ const controller = new AbortController();
const params = {
limit: this.limit,
from: this.from,
- status: this.status,
- type: this.type,
- indexUid: this.indexUid,
+ statuses: this.statuses,
+ types: this.types,
+ indexUids: this.indexUids,
};
- this.meilisearch.getTasks(params).then((data) => {
- this.tasksHolder.results = this.tasksHolder.results.concat(data.results);
- this.tasksHolder.next = data.next;
- this.tasksHolder.isLoading = false;
- });
+ on.cleanup(() => controller.abort());
+
+ this.meilisearch
+ .getTasks(params, { signal: controller.signal })
+ .then((data) => {
+ this.tasksHolder.results = this.tasksHolder.results.concat(
+ data.results
+ );
+ this.tasksHolder.next = data.next;
+ this.tasksHolder.isLoading = false;
+ });
return this.tasksHolder;
});
diff --git a/app/routes/admin/tasks/index.js b/app/routes/admin/tasks/index.js
index db71780..6a5d3f4 100644
--- a/app/routes/admin/tasks/index.js
+++ b/app/routes/admin/tasks/index.js
@@ -8,9 +8,9 @@ export default class AdminTasksIndexRoute extends Route {
queryParams = {
limit: { refreshModel: true },
- status: { refreshModel: true },
- type: { refreshModel: true },
- indexUid: { refreshModel: true },
+ statuses: { refreshModel: true },
+ types: { refreshModel: true },
+ indexUids: { refreshModel: true },
};
model() {
diff --git a/app/services/meilisearch.js b/app/services/meilisearch.js
index ca79524..90879f9 100644
--- a/app/services/meilisearch.js
+++ b/app/services/meilisearch.js
@@ -68,7 +68,7 @@ export default class MeilisearchService extends Service {
}
getDumps() {
- return this.getTasks({ type: 'dumpCreation' });
+ return this.getTasks({ types: 'dumpCreation' });
}
createDump() {
diff --git a/app/templates/admin/tasks/index.hbs b/app/templates/admin/tasks/index.hbs
index 1bd2627..774f013 100644
--- a/app/templates/admin/tasks/index.hbs
+++ b/app/templates/admin/tasks/index.hbs
@@ -1,31 +1,31 @@