Skip to content

Commit

Permalink
fix query for recursive delete of folders
Browse files Browse the repository at this point in the history
  • Loading branch information
bjrmatos committed Oct 3, 2018
1 parent ec6ae31 commit 47a27cf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ function addFolderEntity (reporter) {
})
})

reporter.initializeListeners.add('studio-folder-test', async () => {
reporter.initializeListeners.add('folder-entity', async () => {
reporter.documentStore.collection('folders').beforeInsertListeners.add('folders', (doc) => {
doc.shortid = doc.shortid || nanoid(7)
doc.creationDate = new Date()
Expand All @@ -826,7 +826,9 @@ function addFolderEntity (reporter) {
for (const folder of foldersToRemove) {
for (const c of Object.keys(reporter.documentStore.collections)) {
const entities = await reporter.documentStore.collection(c).find({
folder: folder.shortid
folder: {
shortid: folder.shortid
}
})

if (entities.length === 0) {
Expand Down

0 comments on commit 47a27cf

Please sign in to comment.