2014-02-12 05:23:40 -05:00
|
|
|
Project = require('../../models/Project').Project
|
|
|
|
logger = require('logger-sharelatex')
|
|
|
|
|
|
|
|
module.exports =
|
2018-09-10 06:18:15 -04:00
|
|
|
markAsUpdated : (project_id, user_id, timestamp, callback)->
|
2014-02-12 05:23:40 -05:00
|
|
|
conditions = {_id:project_id}
|
2018-09-10 06:18:15 -04:00
|
|
|
update = {
|
|
|
|
lastUpdated: new Date(timestamp),
|
|
|
|
lastUpdatedBy: user_id
|
|
|
|
}
|
|
|
|
Project.update conditions, update, {}, callback
|
2015-08-13 17:40:28 -04:00
|
|
|
|
|
|
|
markAsOpened : (project_id, callback)->
|
|
|
|
conditions = {_id:project_id}
|
|
|
|
update = {lastOpened:Date.now()}
|
2018-09-10 06:18:15 -04:00
|
|
|
Project.update conditions, update, {}, 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-10 06:18:15 -04:00
|
|
|
Project.update conditions, update, {}, 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-10 06:18:15 -04:00
|
|
|
Project.update conditions, update, {}, callback
|