From 15e7fa6dd312519c13de7ebde37a4010c5a1f562 Mon Sep 17 00:00:00 2001 From: Inga Kirschnick Date: Wed, 7 Jun 2023 14:34:29 +0200 Subject: [PATCH] Rename function --- app/static/js/ResourceLists/CorpusList.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/app/static/js/ResourceLists/CorpusList.js b/app/static/js/ResourceLists/CorpusList.js index 2e41d82e..deebb356 100644 --- a/app/static/js/ResourceLists/CorpusList.js +++ b/app/static/js/ResourceLists/CorpusList.js @@ -21,15 +21,15 @@ class CorpusList extends ResourceList { }); }); app.getUser(this.userId).then((user) => { - this.add(this.equalizer(user)); + this.add(this.aggregateData(user)); this.isInitialized = true; }); } - equalizer(user) { - const equalizedData = []; + aggregateData(user) { + const aggregatedData = []; for (let corpus of Object.values(user.corpora)) { - equalizedData.push( + aggregatedData.push( { 'id': corpus.id, 'creation-date': corpus.creation_date, @@ -43,7 +43,7 @@ class CorpusList extends ResourceList { ); } for (let cfa of Object.values(user.corpus_follower_associations)) { - equalizedData.push( + aggregatedData.push( { 'id': cfa.corpus.id, 'creation-date': cfa.corpus.creation_date, @@ -56,7 +56,7 @@ class CorpusList extends ResourceList { } ); } - return equalizedData; + return aggregatedData; } // #region Mandatory getters and methods to implement @@ -130,10 +130,6 @@ class CorpusList extends ResourceList { `.trim(); } - mapResourceToValue(equalizedData) { - return equalizedData; - } - sort() { this.listjs.sort('creation-date', {order: 'desc'}); }