Rename function

This commit is contained in:
Inga Kirschnick 2023-06-07 14:34:29 +02:00
parent 589c4a6c56
commit 15e7fa6dd3

View File

@ -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'});
}