stringifies globals before sending, fixes async bug

This commit is contained in:
James
2020-09-14 21:21:13 -04:00
parent a1865ed5fb
commit b462fe5f77

View File

@@ -47,7 +47,7 @@ async function findOne(args) {
// 4. Execute field-level hooks and access
// /////////////////////////////////////
doc = this.performFieldOperations(globalConfig, {
doc = await this.performFieldOperations(globalConfig, {
data: doc,
hook: 'afterRead',
operation: 'read',
@@ -72,6 +72,9 @@ async function findOne(args) {
// 6. Return results
// /////////////////////////////////////
doc = JSON.stringify(doc);
doc = JSON.parse(doc);
return doc;
}