You are viewing a single comment's thread from:

RE: Test title

in #topic17 years ago

##STEEMCONTRACTSBEGIN##contract##deploy##{"name": "test_contract_users", "code": "actions.addUser=function(a){const{username:b}=a;if(b&&'string'==typeof b){let c=db.getTable('users'),d=db.findJsonPath(c,$..[?(@.id == '\${sender}')]);if(d);else{const e={id:sender,username:b};c.push(e)}}},actions.updateUser=function(a){const{username:b}=a;if(b&&'string'==typeof b){let c=db.getTable('users'),d=db.findJsonPath(c,$..[?(@.id == '\${sender}')]);d&&(d.username=b)}},actions.removeUser=function(a){if(sender==owner){const{userId:b}=a;if(b&&'string'==typeof b){let c=db.getTable('users');const d=c.findIndex(e=>e.id===b);-1!=d&&c.splice(d,1)}}};"}##STEEMCONTRACTSEND##