2014-02-12 05:23:40 -05:00
|
|
|
Project = require('../../models/Project').Project
|
|
|
|
logger = require('logger-sharelatex')
|
|
|
|
|
|
|
|
module.exports =
|
|
|
|
markAsUpdated : (project_id, callback)->
|
|
|
|
conditions = {_id:project_id}
|
|
|
|
update = {lastUpdated:Date.now()}
|
|
|
|
Project.update conditions, update, {}, (err)->
|
|
|
|
if callback?
|
|
|
|
callback()
|
2015-08-13 17:40:28 -04:00
|
|
|
|
|
|
|
markAsOpened : (project_id, callback)->
|
|
|
|
conditions = {_id:project_id}
|
|
|
|
update = {lastOpened:Date.now()}
|
|
|
|
Project.update conditions, update, {}, (err)->
|
|
|
|
if callback?
|
|
|
|
callback()
|
|
|
|
|
|
|
|
markAsInactive: (project_id, callback)->
|
|
|
|
conditions = {_id:project_id}
|
2015-08-19 06:54:30 -04:00
|
|
|
update = {active:false}
|
2015-08-13 17:40:28 -04:00
|
|
|
Project.update conditions, update, {}, (err)->
|
|
|
|
if callback?
|
|
|
|
callback()
|
|
|
|
|
|
|
|
markAsActive: (project_id, callback)->
|
|
|
|
conditions = {_id:project_id}
|
2015-08-19 06:54:30 -04:00
|
|
|
update = {active:true}
|
2015-08-13 17:40:28 -04:00
|
|
|
Project.update conditions, update, {}, (err)->
|
|
|
|
if callback?
|
|
|
|
callback()
|