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