Refactor repo-projects.ts (#32892)

- Remove jQuery
- Add types to all functions
- Tested all modified functionality

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
silverwind 2024-12-19 09:37:12 +01:00 committed by GitHub
parent dc8f59baa5
commit 141d782c1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 148 additions and 235 deletions

View file

@ -100,7 +100,7 @@ async function linkAction(el: HTMLElement, e: Event) {
const url = el.getAttribute('data-url');
const doRequest = async () => {
if ('disabled' in el) el.disabled = true; // el could be A or BUTTON, but A doesn't have disabled attribute
await fetchActionDoRequest(el, url, {method: 'POST'});
await fetchActionDoRequest(el, url, {method: el.getAttribute('data-link-action-method') || 'POST'});
if ('disabled' in el) el.disabled = false;
};