mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Use the mongojs based apis to get Project and User information.
This commit is contained in:
parent
de02928454
commit
f3db114654
1 changed files with 5 additions and 5 deletions
|
@ -1,8 +1,8 @@
|
||||||
logger = require("logger-sharelatex")
|
logger = require("logger-sharelatex")
|
||||||
request = require("request")
|
request = require("request")
|
||||||
settings = require("settings-sharelatex")
|
settings = require("settings-sharelatex")
|
||||||
Project = require("../../models/Project").Project
|
ProjectGetter = require "../Project/ProjectGetter"
|
||||||
User = require("../../models/User").User
|
UserGetter = require "../User/UserGetter"
|
||||||
DocumentUpdaterHandler = require('../DocumentUpdater/DocumentUpdaterHandler')
|
DocumentUpdaterHandler = require('../DocumentUpdater/DocumentUpdaterHandler')
|
||||||
U = require('underscore')
|
U = require('underscore')
|
||||||
Async = require('async')
|
Async = require('async')
|
||||||
|
@ -32,12 +32,12 @@ module.exports = ReferencesHandler =
|
||||||
return ids
|
return ids
|
||||||
|
|
||||||
_isFullIndex: (project, callback = (err, result) ->) ->
|
_isFullIndex: (project, callback = (err, result) ->) ->
|
||||||
User.findOne { _id: project.owner_ref }, { features: true }, (err, owner) ->
|
UserGetter.getUser project.owner_ref, { features: true }, (err, owner) ->
|
||||||
return callback(err) if err?
|
return callback(err) if err?
|
||||||
callback(null, owner?.features?.references == true)
|
callback(null, owner?.features?.references == true)
|
||||||
|
|
||||||
indexAll: (projectId, callback=(err, data)->) ->
|
indexAll: (projectId, callback=(err, data)->) ->
|
||||||
Project.findOne { _id: projectId }, (err, project) ->
|
ProjectGetter.getProject projectId, {rootFolder: true, owner_ref: 1}, (err, project) ->
|
||||||
if err
|
if err
|
||||||
logger.err {err, projectId}, "error finding project"
|
logger.err {err, projectId}, "error finding project"
|
||||||
return callback(err)
|
return callback(err)
|
||||||
|
@ -46,7 +46,7 @@ module.exports = ReferencesHandler =
|
||||||
ReferencesHandler._doIndexOperation(projectId, project, docIds, callback)
|
ReferencesHandler._doIndexOperation(projectId, project, docIds, callback)
|
||||||
|
|
||||||
index: (projectId, docIds, callback=(err, data)->) ->
|
index: (projectId, docIds, callback=(err, data)->) ->
|
||||||
Project.findOne { _id: projectId }, (err, project) ->
|
ProjectGetter.getProject projectId, {rootFolder: true, owner_ref: 1}, (err, project) ->
|
||||||
if err
|
if err
|
||||||
logger.err {err, projectId}, "error finding project"
|
logger.err {err, projectId}, "error finding project"
|
||||||
return callback(err)
|
return callback(err)
|
||||||
|
|
Loading…
Reference in a new issue