From 4134c32f8d4f31775a9ad53996d2c0accf1d5bad Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 13 Jun 2019 09:37:20 +0100 Subject: [PATCH] Merge pull request #1861 from overleaf/bg-check-existing-import check if project already imported GitOrigin-RevId: 6dbca42fd524c34bb79a86b7449fe6ed3d542b43 --- .../app/src/Features/Project/ProjectGetter.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/services/web/app/src/Features/Project/ProjectGetter.js b/services/web/app/src/Features/Project/ProjectGetter.js index f013e119da..4dd6a177a4 100644 --- a/services/web/app/src/Features/Project/ProjectGetter.js +++ b/services/web/app/src/Features/Project/ProjectGetter.js @@ -148,6 +148,24 @@ module.exports = ProjectGetter = { ) }, + getProjectByV1Id(v1_id, callback) { + if (callback == null) { + callback = function(err, v1_id) {} + } + return Project.findOne({ 'overleaf.id': v1_id }, { _id: 1 }, function( + err, + project + ) { + if (err != null) { + return callback(err) + } + if (project == null) { + return callback() + } + return callback(null, project._id) + }) + }, + findAllUsersProjects(user_id, fields, callback) { if (callback == null) { callback = function(error, projects) {