MCPcopy Index your code
hub / github.com/parse-community/parse-server / toJSONwithObjects

Function toJSONwithObjects

src/triggers.js:188–210  ·  view source on GitHub ↗
(object, className)

Source from the content-addressed store, hash-verified

186}
187
188export function toJSONwithObjects(object, className) {
189 if (!object || !object.toJSON) {
190 return {};
191 }
192 const toJSON = object.toJSON();
193 const stateController = Parse.CoreManager.getObjectStateController();
194 const [pending] = stateController.getPendingOps(object._getStateIdentifier());
195 for (const key in pending) {
196 const val = object.get(key);
197 if (!val || !val._toFullJSON) {
198 toJSON[key] = val;
199 continue;
200 }
201 toJSON[key] = val._toFullJSON();
202 }
203 // Preserve original object's className if no override className is provided
204 if (className) {
205 toJSON.className = className;
206 } else if (object.className && !toJSON.className) {
207 toJSON.className = object.className;
208 }
209 return toJSON;
210}
211
212export function getTrigger(className, triggerType, applicationId) {
213 if (!applicationId) {

Callers 4

_onAfterDeleteMethod · 0.90
_onAfterSaveMethod · 0.90
getResponseObjectFunction · 0.85
maybeRunAfterFindTriggerFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected