Files
Verso/services/web/app/src/Features/ThirdPartyDataStore/TpdsQueueManager.js
T
Eric Mc Sween da30da76b2 Merge pull request #9894 from overleaf/em-node-fetch-web
Replace request-promise with node-fetch in web

GitOrigin-RevId: 07dbb6db7fd42326807aaeb18e5ee39f7c3d4668
2022-10-13 08:04:24 +00:00

26 lines
537 B
JavaScript

const Settings = require('@overleaf/settings')
const OError = require('@overleaf/o-error')
const fetch = require('node-fetch')
async function getQueues(userId) {
const response = await fetch(
`${Settings.apis.tpdsworker.url}/queues/${userId}`,
{
headers: {
Accept: 'application/json',
},
}
)
if (!response.ok) {
throw new OError('failed to query TPDS queues for user', { userId })
}
const body = await response.json()
return body
}
module.exports = {
promises: {
getQueues,
},
}