Fix issue #61: Fix tests
This commit is contained in:
@@ -85,6 +85,9 @@ function loadMapRoutes({ ownsCampaign = true, maps = [], notes = [] } = {}) {
|
||||
},
|
||||
// The pins do not ask after actors, only the token routes below do.
|
||||
"../models/Actor": { findOne: () => mongooseQuery(null) },
|
||||
// The map list's own folder tree: `/list` reads it and `/update` checks a move
|
||||
// against it, so the pins need the model to answer, never what it answers.
|
||||
"../models/Folder": { find: () => mongooseQuery([]), belongsToSection: async () => true },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -181,7 +184,12 @@ function loadNoteRoutes({ ownsCampaign = true, notes = [], folders = [], deleted
|
||||
findById: (id) => mongooseQuery(notes.find((note) => note._id === id) ?? null),
|
||||
deleteOne: () => mongooseQuery({ deletedCount }),
|
||||
},
|
||||
"../models/Folder": { find: () => mongooseQuery(folders) },
|
||||
"../models/Folder": {
|
||||
find: () => mongooseQuery(folders),
|
||||
// models/Folder.js: the note tree is every folder that is not one of the other
|
||||
// campaign lists, whose rows carry no target at all.
|
||||
filterForTarget: (target) => (target === "note" ? { target: { $nin: ["actor", "item", "map"] } } : { target }),
|
||||
},
|
||||
"../models/Map": {
|
||||
// The driver drops the pins of the note from every map holding one; what is worth
|
||||
// keeping here is the filter it is asked to do that with.
|
||||
|
||||
Reference in New Issue
Block a user