|
parseSDK.Cloud.afterSave(c, async req => audit(req.user, 'SAVE', c, req.object, config)); |
|
parseSDK.Cloud.afterDelete(c, async req => audit(req.user, 'DELETE', c, req.object, config)); |
|
parseSDK.Cloud.afterFind(c, async (req) => { |
|
req.objects.forEach(async object => audit(req.user, 'FIND', c, object, config)); |
|
return req.objects; |
|
}); |
The above lines, works if there are no exisiting cloud triggers for the given class.
If the cloud triggers already exists, it will apply the most the recent cloud trigger. If i had my own afterSave trigger registered before calling ParseAuditor, it will be overwritten by the triggers defined by ParseAuditor
I think we need to expose functions that can be called in cloud triggers for this to work fine.
example :- auditSaveRequests(req),auditDeleteRequests(req),auditFindRequests(req)
Steps to reproduce :-
cloud/main.js
ParseAuditor(['Zone'], ['Zone'])
Terminal output :-
warn: Warning: Duplicate cloud functions exist for Zone. Only the last one will be used and the others will be ignored.
warn: Warning: Duplicate cloud functions exist for Zone. Only the last one will be used and the others will be ignored.
warn: Warning: Duplicate cloud functions exist for Zone. Only the last one will be used and the others will be ignored.
parse-auditor/src/index.js
Lines 65 to 66 in fc54640
parse-auditor/src/index.js
Lines 70 to 73 in fc54640
The above lines, works if there are no exisiting cloud triggers for the given class.
If the cloud triggers already exists, it will apply the most the recent cloud trigger. If i had my own
afterSavetrigger registered before callingParseAuditor, it will be overwritten by the triggers defined byParseAuditorI think we need to expose functions that can be called in cloud triggers for this to work fine.
example :-
auditSaveRequests(req),auditDeleteRequests(req),auditFindRequests(req)Steps to reproduce :-
Terminal output :-