WIP because: - [x] Some calls set a `content-type` but send no body, can likely remove the header - [x] Need to check whether `charset=utf-8` has any significance on the webauthn calls, I assume not as it is the default for json content. - [x] Maybe `no-restricted-globals` is better for eslint, but will require a lot of duplication in the yaml or moving eslint config to a `.js` extension. - [x] Maybe export `request` as `fetch`, shadowing the global.
Showing the changes to web_src/js/features/repo-diff-commit.js (1 of 17 files). Show all
Unified · Split
| @@ -1,9 +1,10 @@ | |||
| 1 | import {hideElem, showElem, toggleElem} from '../utils/dom.js'; | 1 | import {hideElem, showElem, toggleElem} from '../utils/dom.js'; |
| 2 | import {GET} from '../modules/fetch.js'; | ||
| 2 | 3 | ||
| 3 | async function loadBranchesAndTags(area, loadingButton) { | 4 | async function loadBranchesAndTags(area, loadingButton) { |
| 4 | loadingButton.classList.add('disabled'); | 5 | loadingButton.classList.add('disabled'); |
| 5 | try { | 6 | try { |
| 6 | const res = await fetch(loadingButton.getAttribute('data-fetch-url')); | 7 | const res = await GET(loadingButton.getAttribute('data-fetch-url')); |
| 7 | const data = await res.json(); | 8 | const data = await res.json(); |
| 8 | hideElem(loadingButton); | 9 | hideElem(loadingButton); |
| 9 | addTags(area, data.tags); | 10 | addTags(area, data.tags); |