{"action":"created","issue":{"url":"https://api.github.com/repos/ShaastraWebops/LeadsPortal/issues/3","labels_url":"https://api.github.com/repos/ShaastraWebops/LeadsPortal/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/ShaastraWebops/LeadsPortal/issues/3/comments","events_url":"https://api.github.com/repos/ShaastraWebops/LeadsPortal/issues/3/events","html_url":"https://github.com/ShaastraWebops/LeadsPortal/issues/3","id":79989095,"number":3,"title":"Add api for editing an update","user":{"login":"chinnichaitanya","id":6941024,"avatar_url":"https://avatars.githubusercontent.com/u/6941024?v=3","gravatar_id":"","url":"https://api.github.com/users/chinnichaitanya","html_url":"https://github.com/chinnichaitanya","followers_url":"https://api.github.com/users/chinnichaitanya/followers","following_url":"https://api.github.com/users/chinnichaitanya/following{/other_user}","gists_url":"https://api.github.com/users/chinnichaitanya/gists{/gist_id}","starred_url":"https://api.github.com/users/chinnichaitanya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinnichaitanya/subscriptions","organizations_url":"https://api.github.com/users/chinnichaitanya/orgs","repos_url":"https://api.github.com/users/chinnichaitanya/repos","events_url":"https://api.github.com/users/chinnichaitanya/events{/privacy}","received_events_url":"https://api.github.com/users/chinnichaitanya/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"kejriwalrahul","id":8914169,"avatar_url":"https://avatars.githubusercontent.com/u/8914169?v=3","gravatar_id":"","url":"https://api.github.com/users/kejriwalrahul","html_url":"https://github.com/kejriwalrahul","followers_url":"https://api.github.com/users/kejriwalrahul/followers","following_url":"https://api.github.com/users/kejriwalrahul/following{/other_user}","gists_url":"https://api.github.com/users/kejriwalrahul/gists{/gist_id}","starred_url":"https://api.github.com/users/kejriwalrahul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kejriwalrahul/subscriptions","organizations_url":"https://api.github.com/users/kejriwalrahul/orgs","repos_url":"https://api.github.com/users/kejriwalrahul/repos","events_url":"https://api.github.com/users/kejriwalrahul/events{/privacy}","received_events_url":"https://api.github.com/users/kejriwalrahul/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-05-23T23:51:19Z","updated_at":"2015-05-29T03:54:22Z","closed_at":null,"body":"Any *update* can be edited by the *cores* or the *coordinators* who are assigned to that deal.\r\n\r\nSo, we need to have a check on the ```server``` side whether the current logged in user has relevant permissions or not to edit that update. \r\n\r\nMake a controller on the ```client``` side as well a relevant api on the ```server``` side to edit any update. In the ```server``` side controller, you need to check if the ```req.user.role``` is ```core``` or if ```req.user._id``` is one of the ```assignees``` to that deal. Since we have an ```assignees``` field in ```Update model``` also, this should not be a problem.\r\n\r\nSwitch to the branch **fixEditUpdate** which I've already created and work on that branch to fix those issues.\r\n\r\n**Deadline: 29th May 2015, 11:59pm** "},"comment":{"url":"https://api.github.com/repos/ShaastraWebops/LeadsPortal/issues/comments/106674801","html_url":"https://github.com/ShaastraWebops/LeadsPortal/issues/3#issuecomment-106674801","issue_url":"https://api.github.com/repos/ShaastraWebops/LeadsPortal/issues/3","id":106674801,"user":{"login":"chinnichaitanya","id":6941024,"avatar_url":"https://avatars.githubusercontent.com/u/6941024?v=3","gravatar_id":"","url":"https://api.github.com/users/chinnichaitanya","html_url":"https://github.com/chinnichaitanya","followers_url":"https://api.github.com/users/chinnichaitanya/followers","following_url":"https://api.github.com/users/chinnichaitanya/following{/other_user}","gists_url":"https://api.github.com/users/chinnichaitanya/gists{/gist_id}","starred_url":"https://api.github.com/users/chinnichaitanya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinnichaitanya/subscriptions","organizations_url":"https://api.github.com/users/chinnichaitanya/orgs","repos_url":"https://api.github.com/users/chinnichaitanya/repos","events_url":"https://api.github.com/users/chinnichaitanya/events{/privacy}","received_events_url":"https://api.github.com/users/chinnichaitanya/received_events","type":"User","site_admin":false},"created_at":"2015-05-29T03:54:22Z","updated_at":"2015-05-29T03:54:22Z","body":"Also in the ```client``` side, you already have function to launch a angular-material ```modal```. **So all your logic to send the relevant data to the server side must be present in that \r\n```function UpdateEditModalCtrl($scope, $mdDialog, DealPassed, UpdatePassed) { ``` only** in ```deals.controller.js``` file in ```client``` side.\r\n\r\nThere,\r\n\r\n- **```DealPassed```** - Gives you all the details of the ```deal``` which has the ```update``` you are about to edit. Use ```console.log()``` statement to see what all it has.\r\n- **```UpdatePassed```** - Gives you all the details of the ```update``` you are about to edit. Again use ```console.log()``` statement to see what all it has.\r\nYou need to pass ```LeadsPortalService``` module to the ```UpdateEditModalCtrl``` function to make ```api``` calls to the server side.\r\n\r\nAll the``` $http``` functions you need to define to make the ```api``` calls to the server side must be in ```leadsPortalService.service.js``` file in ```client/app/leadsPortal``` folder."}}