Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions spec/CloudCode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3224,6 +3224,15 @@ describe('afterLogin hook', () => {
const query = new Parse.Query(TestObject);
await query.find({ context: { a: 'a' } });
});

it('afterFind should have access to context while making fetch call', async () => {
Parse.Cloud.afterFind('TestObject', req => {
expect(req.context.a).toEqual('a');
});
const obj = new TestObject();
await obj.save();
await obj.fetch({ context: { a: 'a' } });
});
});

describe('saveFile hooks', () => {
Expand Down
3 changes: 2 additions & 1 deletion src/Routers/ClassesRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export class ClassesRouter extends PromiseRouter {
this.className(req),
req.params.objectId,
options,
req.info.clientSDK
req.info.clientSDK,
req.info.context
)
.then(response => {
if (!response.results || response.results.length == 0) {
Expand Down