da30da76b2
Replace request-promise with node-fetch in web GitOrigin-RevId: 07dbb6db7fd42326807aaeb18e5ee39f7c3d4668
26 lines
537 B
JavaScript
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,
|
|
},
|
|
}
|