mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-29 11:31:35 +00:00
19 lines
682 B
CoffeeScript
19 lines
682 B
CoffeeScript
Project = require('../../models/Project').Project
|
|
logger = require('logger-sharelatex')
|
|
editorController = require('../Editor/EditorController')
|
|
|
|
|
|
module.exports =
|
|
|
|
markAsDeletedByExternalSource : (project_id, callback)->
|
|
logger.log project_id:project_id, "marking project as deleted by external data source"
|
|
conditions = {_id:project_id}
|
|
update = {deletedByExternalDataSource:true}
|
|
|
|
Project.update conditions, update, {}, (err)->
|
|
editorController.notifyUsersProjectHasBeenDeletedOrRenamed project_id, ->
|
|
callback()
|
|
|
|
deleteUsersProjects: (owner_id, callback)->
|
|
logger.log owner_id:owner_id, "deleting users projects"
|
|
Project.remove owner_ref:owner_id, callback
|