Skip to content

Instantly share code, notes, and snippets.

@Kevinwlee
Last active December 31, 2015 22:48
Show Gist options
  • Save Kevinwlee/8055520 to your computer and use it in GitHub Desktop.
Save Kevinwlee/8055520 to your computer and use it in GitHub Desktop.
Carbon Context Functions
function (event, vault, push) {
var vault_id = event.payload.vault.vault_info.id;
var data=vault.find(vault_id);
data.office = event.data.fence.id;
vault.update(vault_id, data)
push.sendToTags(1, [event.data.fence.id], "office_employee_changed", false );
true;
}
function (event, vault, push) {
var vault_id = event.payload.vault.vault_info.id;
var data=vault.find(vault_id);
data.office = "";
vault.update(vault_id, data)
push.sendToTags(1, [event.data.fence.id], "office_employee_changed", false );
true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment