Update Public Corpus Page

This commit is contained in:
Inga Kirschnick
2023-05-15 14:01:41 +02:00
parent 0cf955bd2f
commit ce32b03f4a
6 changed files with 62 additions and 84 deletions

View File

@ -152,7 +152,14 @@ class CorpusFileList extends ResourceList {
);
let confirmElement = modalElement.querySelector('.action-button[data-action="confirm"]');
confirmElement.addEventListener('click', (event) => {
Requests.corpora.entity.files.ent.delete(this.corpusId, itemId);
if (currentUserId != this.userId) {
Requests.corpora.entity.files.ent.delete(this.corpusId, itemId)
.then(() => {
window.location.reload();
});
} else {
Requests.corpora.entity.followers.entity.delete(this.corpusId, followerId);
}
});
modal.open();
break;

View File

@ -142,7 +142,14 @@ class CorpusFollowerList extends ResourceList {
switch (listAction) {
case 'unfollow-request': {
let followerId = listItemElement.dataset.followerId;
Requests.corpora.entity.followers.entity.delete(this.corpusId, followerId);
if (currentUserId != this.userId) {
Requests.corpora.entity.followers.entity.delete(this.corpusId, followerId)
.then(() => {
window.location.reload();
});
} else {
Requests.corpora.entity.followers.entity.delete(this.corpusId, followerId);
}
break;
}
case 'view': {