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:
@@ -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' } });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user