mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-24 23:00:44 +00:00
Merge pull request #1861 from overleaf/bg-check-existing-import
check if project already imported GitOrigin-RevId: 6dbca42fd524c34bb79a86b7449fe6ed3d542b43
This commit is contained in:
parent
c242a8d4c1
commit
4134c32f8d
1 changed files with 18 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue