From 567efe007f723a366a96ce4cee54dd3391349d98 Mon Sep 17 00:00:00 2001 From: Eric Mc Sween Date: Thu, 13 Oct 2022 11:40:15 -0400 Subject: [PATCH] Merge pull request #9962 from overleaf/em-remove-project-history-importer Remove the separate config for project history importer GitOrigin-RevId: 7f3eee81ea570241e7aba2a86684c8495a567e7f --- .../src/Features/History/HistoryManager.js | 49 +++++++------------ 1 file changed, 17 insertions(+), 32 deletions(-) diff --git a/services/web/app/src/Features/History/HistoryManager.js b/services/web/app/src/Features/History/HistoryManager.js index 0f564ac91b..e6da673afa 100644 --- a/services/web/app/src/Features/History/HistoryManager.js +++ b/services/web/app/src/Features/History/HistoryManager.js @@ -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, + }, +}