MCPcopy Create free account
hub / github.com/CloudBoost/cloudboost / _sendNotification

Function _sendNotification

services/cloudObjects.js:331–350  ·  view source on GitHub ↗
(appId, res, reqType)

Source from the content-addressed store, hash-verified

329}
330
331function _sendNotification(appId, res, reqType) {
332 try {
333 for (let i = 0; i < res.value.length; i++) {
334 if (res.value[i].state === 'fulfilled') {
335 if (reqType.save.indexOf(res.value[i].value._id) >= 0) {
336 config.realTime.sendObjectNotification(appId, res.value[i].value, 'created');
337 } else {
338 config.realTime.sendObjectNotification(appId, res.value[i].value, 'updated');
339 }
340 }
341 }
342 return '';
343 } catch (err) {
344 winston.log('error', {
345 error: String(err),
346 stack: new Error().stack,
347 });
348 return null;
349 }
350}
351
352async function _isSchemaValid(appId, collectionName, document, accessList, isMasterKey, encryption_key) {
353 const mainPromise = q.defer();

Callers 1

_saveFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected