overleaf/services/web/app/coffee/Features/Project/ProjectUpdateHandler.coffee

32 lines
894 B
CoffeeScript
Raw Normal View History

2014-02-12 05:23:40 -05:00
Project = require('../../models/Project').Project
logger = require('logger-sharelatex')
Project = require("../../models/Project").Project
2014-02-12 05:23:40 -05:00
module.exports =
markAsUpdated : (project_id, callback)->
conditions = {_id:project_id}
update = {lastUpdated:Date.now()}
Project.update conditions, update, {}, (err)->
if callback?
callback()
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}
update = {active:false}
Project.update conditions, update, {}, (err)->
if callback?
callback()
markAsActive: (project_id, callback)->
conditions = {_id:project_id}
update = {active:true}
Project.update conditions, update, {}, (err)->
if callback?
callback()