mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-26 21:11:13 +00:00
Merge pull request #9962 from overleaf/em-remove-project-history-importer
Remove the separate config for project history importer GitOrigin-RevId: 7f3eee81ea570241e7aba2a86684c8495a567e7f
This commit is contained in:
parent
a4c76ba1ec
commit
567efe007f
1 changed files with 17 additions and 32 deletions
|
@ -4,25 +4,6 @@ const settings = require('@overleaf/settings')
|
|||
const OError = require('@overleaf/o-error')
|
||||
const UserGetter = require('../User/UserGetter')
|
||||
|
||||
module.exports = {
|
||||
initializeProject: callbackify(initializeProject),
|
||||
flushProject: callbackify(flushProject),
|
||||
flushMigration: callbackify(flushMigration),
|
||||
resyncProject: callbackify(resyncProject),
|
||||
deleteProject: callbackify(deleteProject),
|
||||
deleteProjectHistory: callbackify(deleteProjectHistory),
|
||||
injectUserDetails: callbackify(injectUserDetails),
|
||||
promises: {
|
||||
initializeProject,
|
||||
flushProject,
|
||||
flushMigration,
|
||||
resyncProject,
|
||||
deleteProject,
|
||||
injectUserDetails,
|
||||
deleteProjectHistory,
|
||||
},
|
||||
}
|
||||
|
||||
async function initializeProject() {
|
||||
if (
|
||||
!(
|
||||
|
@ -64,19 +45,6 @@ async function flushProject(projectId) {
|
|||
}
|
||||
}
|
||||
|
||||
async function flushMigration(projectId) {
|
||||
const response = await fetch(
|
||||
`${settings.apis.project_history_importer.url}/project/${projectId}/flush`,
|
||||
{ method: 'POST' }
|
||||
)
|
||||
if (!response.ok) {
|
||||
throw new OError(
|
||||
'failed to flush project migration to project history importer',
|
||||
{ projectId, statusCode: response.status }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteProjectHistory(projectId) {
|
||||
const response = await fetch(
|
||||
`${settings.apis.project_history.url}/project/${projectId}`,
|
||||
|
@ -238,3 +206,20 @@ function _userView(user) {
|
|||
const { _id, first_name: firstName, last_name: lastName, email } = user
|
||||
return { first_name: firstName, last_name: lastName, email, id: _id }
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
initializeProject: callbackify(initializeProject),
|
||||
flushProject: callbackify(flushProject),
|
||||
resyncProject: callbackify(resyncProject),
|
||||
deleteProject: callbackify(deleteProject),
|
||||
deleteProjectHistory: callbackify(deleteProjectHistory),
|
||||
injectUserDetails: callbackify(injectUserDetails),
|
||||
promises: {
|
||||
initializeProject,
|
||||
flushProject,
|
||||
resyncProject,
|
||||
deleteProject,
|
||||
injectUserDetails,
|
||||
deleteProjectHistory,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue