Skip to content

Commit

Permalink
Merge pull request #110 from rogershi-dev/feature/registration-auth
Browse files Browse the repository at this point in the history
Removed redundant declarations of 'currentPage' and 'perPage'
  • Loading branch information
rogershi-dev authored Jul 14, 2024
2 parents 6163472 + 05d2b58 commit 2506f25
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions server/views/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -220,35 +220,35 @@ block content
modal.style.display = 'flex';
}

function handleRepoAction(repoName, hasSetWebhook) {
fetch(`/webhook/config?repo=${repoName}&hassetwebhook=${hasSetWebhook}`)
.then(response => response.json())
.then(data => {
if (data.success) {
//- const repoCard = document.querySelector(`.card-body[data-repo-name="${repoName}"]`);
//- const webhookIcon = repoCard.querySelector('.bi-check2-all');
//- if (hasSetWebhook) {
//- if (webhookIcon) webhookIcon.remove();
//- } else {
//- if (!webhookIcon) {
//- const icon = document.createElement('i');
//- icon.className = 'bi bi-check2-all';
//- icon.style = 'font-weight: bolder; font-size: 24px; color: green;';
//- repoCard.querySelector('h5.card-title').appendChild(icon);
//- }
//- }
//- repoCard.setAttribute('webhook-repo-status', data.hasSetWebhook);
const page = parseInt(currentPage) || 1;
const perpage = parseInt(perPage) || 15;
window.location.href = `/?page=${page}&per_page=${perpage}`;
document.getElementById('repoModal').style.display = 'none';
}
})
.catch(error => {
console.error('Error:', error);
document.getElementById('repoModal').style.display = 'none';
});
}
//- function handleRepoAction(repoName, hasSetWebhook) {
//- fetch(`/webhook/config?repo=${repoName}&hassetwebhook=${hasSetWebhook}`)
//- .then(response => response.json())
//- .then(data => {
//- if (data.success) {
//- //- const repoCard = document.querySelector(`.card-body[data-repo-name="${repoName}"]`);
//- //- const webhookIcon = repoCard.querySelector('.bi-check2-all');
//- //- if (hasSetWebhook) {
//- //- if (webhookIcon) webhookIcon.remove();
//- //- } else {
//- //- if (!webhookIcon) {
//- //- const icon = document.createElement('i');
//- //- icon.className = 'bi bi-check2-all';
//- //- icon.style = 'font-weight: bolder; font-size: 24px; color: green;';
//- //- repoCard.querySelector('h5.card-title').appendChild(icon);
//- //- }
//- //- }
//- //- repoCard.setAttribute('webhook-repo-status', data.hasSetWebhook);
//- const page = parseInt(currentPage) || 1;
//- const perpage = parseInt(perPage) || 15;
//- window.location.href = `/?page=${page}&per_page=${perpage}`;
//- document.getElementById('repoModal').style.display = 'none';
//- }
//- })
//- .catch(error => {
//- console.error('Error:', error);
//- document.getElementById('repoModal').style.display = 'none';
//- });
//- }

window.onclick = function(event) {
const modal = document.getElementById('repoModal');
Expand Down

0 comments on commit 2506f25

Please sign in to comment.