mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-11 15:10:48 +02:00
Merge pull request #2081 from overleaf/cmg-per-user-trash
Add per-user trashed state to project model GitOrigin-RevId: 16a753702d3503eee011dd2adca5dc8df3da87f4
This commit is contained in:
committed by
sharelatex
parent
c1f8ac8de1
commit
6f2b4d3da3
@@ -31,10 +31,27 @@ module.exports = ProjectHelper = {
|
||||
if (Array.isArray(project.archived)) {
|
||||
return project.archived.find(id => id.equals(userId)) !== undefined
|
||||
} else {
|
||||
return project.archived
|
||||
return !!project.archived
|
||||
}
|
||||
},
|
||||
|
||||
isTrashed(project, userId) {
|
||||
userId = ObjectId(userId)
|
||||
|
||||
if (project.trashed) {
|
||||
return project.trashed.find(id => id.equals(userId)) !== undefined
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
|
||||
isArchivedOrTrashed(project, userId) {
|
||||
return (
|
||||
ProjectHelper.isArchived(project, userId) ||
|
||||
ProjectHelper.isTrashed(project, userId)
|
||||
)
|
||||
},
|
||||
|
||||
ensureNameIsUnique(nameList, name, suffixes, maxLength, callback) {
|
||||
// create a set of all project names
|
||||
if (suffixes == null) {
|
||||
|
||||
Reference in New Issue
Block a user