Merge pull request #1755 from overleaf/bg-admin-resync-project-history

add button to resync history for project in admin page

GitOrigin-RevId: e52e85ee6d1f7dea7930bf3dee0ec70b28b8a6c2
This commit is contained in:
Brian Gough 2019-05-13 09:37:36 +01:00 committed by sharelatex
parent 69ccac8f49
commit d1cc605855
2 changed files with 12 additions and 1 deletions

View file

@ -38,6 +38,17 @@ module.exports = HistoryManager =
error = new Error("project-history returned a non-success status code: #{res.statusCode}")
callback error
resyncProject: (project_id, callback = (error) ->) ->
request.post {
url: "#{settings.apis.project_history.url}/project/#{project_id}/resync"
}, (error, res, body)->
return callback(error) if error?
if res.statusCode >= 200 and res.statusCode < 300
callback()
else
error = new Error("project-history returned a non-success status code: #{res.statusCode}")
callback error
injectUserDetails: (data, callback = (error, data_with_users) ->) ->
# data can be either:
# {

View file

@ -1,6 +1,6 @@
Settings = require "settings-sharelatex"
mongojs = require "mongojs"
db = mongojs(Settings.mongo.url, ["projects", "users", "userstubs", "tokens", "docSnapshots"])
db = mongojs(Settings.mongo.url, ["projects", "users", "userstubs", "tokens", "docSnapshots", "projectHistoryFailures"])
module.exports =
db: db
ObjectId: mongojs.ObjectId