Merge pull request #20058 from overleaf/mj-promisify-tpr

[third-party-references] Promisify third-party-references

GitOrigin-RevId: cfc462abaca95ed10798b3d1756950f2997a5947
This commit is contained in:
Mathias Jakobsen 2024-08-30 09:11:46 +01:00 committed by Copybot
parent b28d9c15e4
commit 496a63cf23
2 changed files with 5 additions and 1 deletions

View file

@ -21,7 +21,7 @@ async function fetchJson(url, opts = {}) {
async function fetchJsonWithResponse(url, opts = {}) {
const { fetchOpts } = parseOpts(opts)
fetchOpts.headers = fetchOpts.headers ?? {}
fetchOpts.headers.Accept = 'application/json'
fetchOpts.headers.Accept = fetchOpts.headers.Accept ?? 'application/json'
const response = await performRequest(url, fetchOpts)
if (!response.ok) {

4
package-lock.json generated
View file

@ -44437,9 +44437,11 @@
"license": "ISC",
"dependencies": {
"@overleaf/access-token-encryptor": "*",
"@overleaf/fetch-utils": "*",
"@overleaf/logger": "*",
"@overleaf/metrics": "*",
"@overleaf/o-error": "*",
"@overleaf/promise-utils": "*",
"@overleaf/settings": "*",
"async": "^3.2.5",
"body-parser": "^1.19.0",
@ -53128,9 +53130,11 @@
"version": "file:services/third-party-references",
"requires": {
"@overleaf/access-token-encryptor": "*",
"@overleaf/fetch-utils": "*",
"@overleaf/logger": "*",
"@overleaf/metrics": "*",
"@overleaf/o-error": "*",
"@overleaf/promise-utils": "*",
"@overleaf/settings": "*",
"@types/simple-oauth2": "^5.0.7",
"async": "^3.2.5",