Skip to content

Commit 7afd044

Browse files
authored
Adding Missing Await (#20)
Because this `await` statement was missing, when using the findOne hook, the code was moving forward before having the results of the authLevel check. Now it waits.
1 parent 3dbd63f commit 7afd044

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
const test = require('ava');
22

33
test.todo('Migrate SanitizeDocumentList tests to this file');
4+
test.todo('Make sure async stuff is handled correctly for every logic path');

src/sanitizeDocumentList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async function sanitizeDocumentList(schema, options, docs) {
6969
const multi = _.isArrayLike(docs);
7070

7171
if (!multi) {
72-
sanitizeDocument(schema, options, docs);
72+
await sanitizeDocument(schema, options, docs);
7373
return;
7474
}
7575

0 commit comments

Comments
 (0)