Fix: context for afterFind (#7078)

* Fix: context for afterFind

* Update CHANGELOG.md

Co-authored-by: Manuel <trezza.m@gmail.com>
This commit is contained in:
dblythy
2020-12-19 00:54:48 +11:00
committed by GitHub
parent 97c3046f3f
commit 41a052c2c3
5 changed files with 60 additions and 10 deletions

View File

@@ -3157,4 +3157,14 @@ describe('afterLogin hook', () => {
await Parse.Cloud.run('contextTest', {}, { context: { a: 'a' } });
});
it('afterFind should have access to context', async () => {
Parse.Cloud.afterFind('TestObject', req => {
expect(req.context.a).toEqual('a');
});
const obj = new TestObject();
await obj.save();
const query = new Parse.Query(TestObject);
await query.find({ context: { a: 'a' } });
});
});