mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 02:51:57 +02: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:
@@ -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,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user