{"action":"created","comment":{"url":"https://api.github.com/repos/UB-ES-2018/faceduck/pulls/comments/226827686","pull_request_review_id":166750156,"id":226827686,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNjgyNzY4Ng==","diff_hunk":"@@ -115,3 +115,70 @@ def search_posts():\n     except FaceduckError as e:\n         return client_error(e.id)\n \n+\n+@api.route('/user/friends', methods=[\"POST\"])\n+@jwt_required\n+def create_friendship():\n+\n+    try:\n+        user_id = request.json[\"user_id\"]\n+        target_id = request.json[\"target_id\"]\n+    except KeyError:\n+        return client_error(\"001\")\n+\n+    friendship = core.create_friendship(user_id,target_id)\n+\n+    try:\n+        return jsonify(user_id=friendship.user_id, target_id=friendship.target_id,state=friendship.state)\n+    except FaceduckError as e:\n+        return client_error(e.id)\n+\n+@api.route('/user/friends', methods=[\"PUT\"])\n+@jwt_required\n+def update_friendship():\n+\n+    try:\n+        user_id = request.json[\"user_id\"]","path":"backend/app/faceduck/views/api.py","position":27,"original_position":27,"commit_id":"8fe465fd64ddcc878f03cb6f0413cd1189f5d955","original_commit_id":"8fe465fd64ddcc878f03cb6f0413cd1189f5d955","user":{"login":"ifrins","id":757530,"node_id":"MDQ6VXNlcjc1NzUzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/757530?v=4","gravatar_id":"","url":"https://api.github.com/users/ifrins","html_url":"https://github.com/ifrins","followers_url":"https://api.github.com/users/ifrins/followers","following_url":"https://api.github.com/users/ifrins/following{/other_user}","gists_url":"https://api.github.com/users/ifrins/gists{/gist_id}","starred_url":"https://api.github.com/users/ifrins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ifrins/subscriptions","organizations_url":"https://api.github.com/users/ifrins/orgs","repos_url":"https://api.github.com/users/ifrins/repos","events_url":"https://api.github.com/users/ifrins/events{/privacy}","received_events_url":"https://api.github.com/users/ifrins/received_events","type":"User","site_admin":false},"body":"idem","created_at":"2018-10-20T13:48:42Z","updated_at":"2018-10-20T13:53:17Z","html_url":"https://github.com/UB-ES-2018/faceduck/pull/94#discussion_r226827686","pull_request_url":"https://api.github.com/repos/UB-ES-2018/faceduck/pulls/94","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/UB-ES-2018/faceduck/pulls/comments/226827686"},"html":{"href":"https://github.com/UB-ES-2018/faceduck/pull/94#discussion_r226827686"},"pull_request":{"href":"https://api.github.com/repos/UB-ES-2018/faceduck/pulls/94"}}},"pull_request":{"url":"https://api.github.com/repos/UB-ES-2018/faceduck/pulls/94","id":224362665,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0MzYyNjY1","html_url":"https://github.com/UB-ES-2018/faceduck/pull/94","diff_url":"https://github.com/UB-ES-2018/faceduck/pull/94.diff","patch_url":"https://github.com/UB-ES-2018/faceduck/pull/94.patch","issue_url":"https://api.github.com/repos/UB-ES-2018/faceduck/issues/94","number":94,"state":"open","locked":false,"title":"US-09-Connect Users","user":{"login":"Xexio15","id":22416074,"node_id":"MDQ6VXNlcjIyNDE2MDc0","avatar_url":"https://avatars0.githubusercontent.com/u/22416074?v=4","gravatar_id":"","url":"https://api.github.com/users/Xexio15","html_url":"https://github.com/Xexio15","followers_url":"https://api.github.com/users/Xexio15/followers","following_url":"https://api.github.com/users/Xexio15/following{/other_user}","gists_url":"https://api.github.com/users/Xexio15/gists{/gist_id}","starred_url":"https://api.github.com/users/Xexio15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Xexio15/subscriptions","organizations_url":"https://api.github.com/users/Xexio15/orgs","repos_url":"https://api.github.com/users/Xexio15/repos","events_url":"https://api.github.com/users/Xexio15/events{/privacy}","received_events_url":"https://api.github.com/users/Xexio15/received_events","type":"User","site_admin":false},"body":"He creat el model de Friendship que connecta als Users segons la idea que he parlat amb @ifrins, he implementat:  \r\n- La creacio de les amistads\r\n- Poder actualitzar les amistads \r\n- Poder fer un get de totes les amistads d'un usuari\r\n\r\nTambé he afegit la info a la API. \r\n  \r\nEspero que no sigui molt desastre el codi qualsevol cosa a canviar m'ho dieu sense problemes que segurament hi hagi més d'una cosa millorable. Alguna funcionalitat que veieu que trobeu a faltar o si en els noms dels endpoints veieu alguna opcio més correcte els modificare perque no sabia ben be com organitzar-ho.\r\n\r\nPD: He provat tot amb el Postman y funciona\r\n","created_at":"2018-10-19T17:47:32Z","updated_at":"2018-10-20T13:53:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2e6d1ae3773378b79d5d899831aa958c242d9eb4","assignee":null,"assignees":[],"requested_reviewers":[{"login":"dabytmc","id":11098030,"node_id":"MDQ6VXNlcjExMDk4MDMw","avatar_url":"https://avatars3.githubusercontent.com/u/11098030?v=4","gravatar_id":"","url":"https://api.github.com/users/dabytmc","html_url":"https://github.com/dabytmc","followers_url":"https://api.github.com/users/dabytmc/followers","following_url":"https://api.github.com/users/dabytmc/following{/other_user}","gists_url":"https://api.github.com/users/dabytmc/gists{/gist_id}","starred_url":"https://api.github.com/users/dabytmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dabytmc/subscriptions","organizations_url":"https://api.github.com/users/dabytmc/orgs","repos_url":"https://api.github.com/users/dabytmc/repos","events_url":"https://api.github.com/users/dabytmc/events{/privacy}","received_events_url":"https://api.github.com/users/dabytmc/received_events","type":"User","site_admin":false},{"login":"FlorenzoC","id":11157675,"node_id":"MDQ6VXNlcjExMTU3Njc1","avatar_url":"https://avatars1.githubusercontent.com/u/11157675?v=4","gravatar_id":"","url":"https://api.github.com/users/FlorenzoC","html_url":"https://github.com/FlorenzoC","followers_url":"https://api.github.com/users/FlorenzoC/followers","following_url":"https://api.github.com/users/FlorenzoC/following{/other_user}","gists_url":"https://api.github.com/users/FlorenzoC/gists{/gist_id}","starred_url":"https://api.github.com/users/FlorenzoC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FlorenzoC/subscriptions","organizations_url":"https://api.github.com/users/FlorenzoC/orgs","repos_url":"https://api.github.com/users/FlorenzoC/repos","events_url":"https://api.github.com/users/FlorenzoC/events{/privacy}","received_events_url":"https://api.github.com/users/FlorenzoC/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/UB-ES-2018/faceduck/pulls/94/commits","review_comments_url":"https://api.github.com/repos/UB-ES-2018/faceduck/pulls/94/comments","review_comment_url":"https://api.github.com/repos/UB-ES-2018/faceduck/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UB-ES-2018/faceduck/issues/94/comments","statuses_url":"https://api.github.com/repos/UB-ES-2018/faceduck/statuses/8fe465fd64ddcc878f03cb6f0413cd1189f5d955","head":{"label":"UB-ES-2018:US-09-Connect-UsersToUsers","ref":"US-09-Connect-UsersToUsers","sha":"8fe465fd64ddcc878f03cb6f0413cd1189f5d955","user":{"login":"UB-ES-2018","id":43435215,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzNDM1MjE1","avatar_url":"https://avatars1.githubusercontent.com/u/43435215?v=4","gravatar_id":"","url":"https://api.github.com/users/UB-ES-2018","html_url":"https://github.com/UB-ES-2018","followers_url":"https://api.github.com/users/UB-ES-2018/followers","following_url":"https://api.github.com/users/UB-ES-2018/following{/other_user}","gists_url":"https://api.github.com/users/UB-ES-2018/gists{/gist_id}","starred_url":"https://api.github.com/users/UB-ES-2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UB-ES-2018/subscriptions","organizations_url":"https://api.github.com/users/UB-ES-2018/orgs","repos_url":"https://api.github.com/users/UB-ES-2018/repos","events_url":"https://api.github.com/users/UB-ES-2018/events{/privacy}","received_events_url":"https://api.github.com/users/UB-ES-2018/received_events","type":"Organization","site_admin":false},"repo":{"id":149576304,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk1NzYzMDQ=","name":"faceduck","full_name":"UB-ES-2018/faceduck","private":false,"owner":{"login":"UB-ES-2018","id":43435215,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzNDM1MjE1","avatar_url":"https://avatars1.githubusercontent.com/u/43435215?v=4","gravatar_id":"","url":"https://api.github.com/users/UB-ES-2018","html_url":"https://github.com/UB-ES-2018","followers_url":"https://api.github.com/users/UB-ES-2018/followers","following_url":"https://api.github.com/users/UB-ES-2018/following{/other_user}","gists_url":"https://api.github.com/users/UB-ES-2018/gists{/gist_id}","starred_url":"https://api.github.com/users/UB-ES-2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UB-ES-2018/subscriptions","organizations_url":"https://api.github.com/users/UB-ES-2018/orgs","repos_url":"https://api.github.com/users/UB-ES-2018/repos","events_url":"https://api.github.com/users/UB-ES-2018/events{/privacy}","received_events_url":"https://api.github.com/users/UB-ES-2018/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/UB-ES-2018/faceduck","description":null,"fork":false,"url":"https://api.github.com/repos/UB-ES-2018/faceduck","forks_url":"https://api.github.com/repos/UB-ES-2018/faceduck/forks","keys_url":"https://api.github.com/repos/UB-ES-2018/faceduck/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UB-ES-2018/faceduck/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UB-ES-2018/faceduck/teams","hooks_url":"https://api.github.com/repos/UB-ES-2018/faceduck/hooks","issue_events_url":"https://api.github.com/repos/UB-ES-2018/faceduck/issues/events{/number}","events_url":"https://api.github.com/repos/UB-ES-2018/faceduck/events","assignees_url":"https://api.github.com/repos/UB-ES-2018/faceduck/assignees{/user}","branches_url":"https://api.github.com/repos/UB-ES-2018/faceduck/branches{/branch}","tags_url":"https://api.github.com/repos/UB-ES-2018/faceduck/tags","blobs_url":"https://api.github.com/repos/UB-ES-2018/faceduck/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UB-ES-2018/faceduck/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UB-ES-2018/faceduck/git/refs{/sha}","trees_url":"https://api.github.com/repos/UB-ES-2018/faceduck/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UB-ES-2018/faceduck/statuses/{sha}","languages_url":"https://api.github.com/repos/UB-ES-2018/faceduck/languages","stargazers_url":"https://api.github.com/repos/UB-ES-2018/faceduck/stargazers","contributors_url":"https://api.github.com/repos/UB-ES-2018/faceduck/contributors","subscribers_url":"https://api.github.com/repos/UB-ES-2018/faceduck/subscribers","subscription_url":"https://api.github.com/repos/UB-ES-2018/faceduck/subscription","commits_url":"https://api.github.com/repos/UB-ES-2018/faceduck/commits{/sha}","git_commits_url":"https://api.github.com/repos/UB-ES-2018/faceduck/git/commits{/sha}","comments_url":"https://api.github.com/repos/UB-ES-2018/faceduck/comments{/number}","issue_comment_url":"https://api.github.com/repos/UB-ES-2018/faceduck/issues/comments{/number}","contents_url":"https://api.github.com/repos/UB-ES-2018/faceduck/contents/{+path}","compare_url":"https://api.github.com/repos/UB-ES-2018/faceduck/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UB-ES-2018/faceduck/merges","archive_url":"https://api.github.com/repos/UB-ES-2018/faceduck/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UB-ES-2018/faceduck/downloads","issues_url":"https://api.github.com/repos/UB-ES-2018/faceduck/issues{/number}","pulls_url":"https://api.github.com/repos/UB-ES-2018/faceduck/pulls{/number}","milestones_url":"https://api.github.com/repos/UB-ES-2018/faceduck/milestones{/number}","notifications_url":"https://api.github.com/repos/UB-ES-2018/faceduck/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UB-ES-2018/faceduck/labels{/name}","releases_url":"https://api.github.com/repos/UB-ES-2018/faceduck/releases{/id}","deployments_url":"https://api.github.com/repos/UB-ES-2018/faceduck/deployments","created_at":"2018-09-20T08:24:11Z","updated_at":"2018-10-19T14:05:17Z","pushed_at":"2018-10-20T11:06:20Z","git_url":"git://github.com/UB-ES-2018/faceduck.git","ssh_url":"git@github.com:UB-ES-2018/faceduck.git","clone_url":"https://github.com/UB-ES-2018/faceduck.git","svn_url":"https://github.com/UB-ES-2018/faceduck","homepage":null,"size":373,"stargazers_count":5,"watchers_count":5,"language":"Vue","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":11,"license":null,"forks":0,"open_issues":11,"watchers":5,"default_branch":"SP2"}},"base":{"label":"UB-ES-2018:SP2","ref":"SP2","sha":"2bf1187385039a3859a6e2b52f96fc9ad40b3d52","user":{"login":"UB-ES-2018","id":43435215,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzNDM1MjE1","avatar_url":"https://avatars1.githubusercontent.com/u/43435215?v=4","gravatar_id":"","url":"https://api.github.com/users/UB-ES-2018","html_url":"https://github.com/UB-ES-2018","followers_url":"https://api.github.com/users/UB-ES-2018/followers","following_url":"https://api.github.com/users/UB-ES-2018/following{/other_user}","gists_url":"https://api.github.com/users/UB-ES-2018/gists{/gist_id}","starred_url":"https://api.github.com/users/UB-ES-2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UB-ES-2018/subscriptions","organizations_url":"https://api.github.com/users/UB-ES-2018/orgs","repos_url":"https://api.github.com/users/UB-ES-2018/repos","events_url":"https://api.github.com/users/UB-ES-2018/events{/privacy}","received_events_url":"https://api.github.com/users/UB-ES-2018/received_events","type":"Organization","site_admin":false},"repo":{"id":149576304,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk1NzYzMDQ=","name":"faceduck","full_name":"UB-ES-2018/faceduck","private":false,"owner":{"login":"UB-ES-2018","id":43435215,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzNDM1MjE1","avatar_url":"https://avatars1.githubusercontent.com/u/43435215?v=4","gravatar_id":"","url":"https://api.github.com/users/UB-ES-2018","html_url":"https://github.com/UB-ES-2018","followers_url":"https://api.github.com/users/UB-ES-2018/followers","following_url":"https://api.github.com/users/UB-ES-2018/following{/other_user}","gists_url":"https://api.github.com/users/UB-ES-2018/gists{/gist_id}","starred_url":"https://api.github.com/users/UB-ES-2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UB-ES-2018/subscriptions","organizations_url":"https://api.github.com/users/UB-ES-2018/orgs","repos_url":"https://api.github.com/users/UB-ES-2018/repos","events_url":"https://api.github.com/users/UB-ES-2018/events{/privacy}","received_events_url":"https://api.github.com/users/UB-ES-2018/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/UB-ES-2018/faceduck","description":null,"fork":false,"url":"https://api.github.com/repos/UB-ES-2018/faceduck","forks_url":"https://api.github.com/repos/UB-ES-2018/faceduck/forks","keys_url":"https://api.github.com/repos/UB-ES-2018/faceduck/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UB-ES-2018/faceduck/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UB-ES-2018/faceduck/teams","hooks_url":"https://api.github.com/repos/UB-ES-2018/faceduck/hooks","issue_events_url":"https://api.github.com/repos/UB-ES-2018/faceduck/issues/events{/number}","events_url":"https://api.github.com/repos/UB-ES-2018/faceduck/events","assignees_url":"https://api.github.com/repos/UB-ES-2018/faceduck/assignees{/user}","branches_url":"https://api.github.com/repos/UB-ES-2018/faceduck/branches{/branch}","tags_url":"https://api.github.com/repos/UB-ES-2018/faceduck/tags","blobs_url":"https://api.github.com/repos/UB-ES-2018/faceduck/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UB-ES-2018/faceduck/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UB-ES-2018/faceduck/git/refs{/sha}","trees_url":"https://api.github.com/repos/UB-ES-2018/faceduck/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UB-ES-2018/faceduck/statuses/{sha}","languages_url":"https://api.github.com/repos/UB-ES-2018/faceduck/languages","stargazers_url":"https://api.github.com/repos/UB-ES-2018/faceduck/stargazers","contributors_url":"https://api.github.com/repos/UB-ES-2018/faceduck/contributors","subscribers_url":"https://api.github.com/repos/UB-ES-2018/faceduck/subscribers","subscription_url":"https://api.github.com/repos/UB-ES-2018/faceduck/subscription","commits_url":"https://api.github.com/repos/UB-ES-2018/faceduck/commits{/sha}","git_commits_url":"https://api.github.com/repos/UB-ES-2018/faceduck/git/commits{/sha}","comments_url":"https://api.github.com/repos/UB-ES-2018/faceduck/comments{/number}","issue_comment_url":"https://api.github.com/repos/UB-ES-2018/faceduck/issues/comments{/number}","contents_url":"https://api.github.com/repos/UB-ES-2018/faceduck/contents/{+path}","compare_url":"https://api.github.com/repos/UB-ES-2018/faceduck/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UB-ES-2018/faceduck/merges","archive_url":"https://api.github.com/repos/UB-ES-2018/faceduck/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UB-ES-2018/faceduck/downloads","issues_url":"https://api.github.com/repos/UB-ES-2018/faceduck/issues{/number}","pulls_url":"https://api.github.com/repos/UB-ES-2018/faceduck/pulls{/number}","milestones_url":"https://api.github.com/repos/UB-ES-2018/faceduck/milestones{/number}","notifications_url":"https://api.github.com/repos/UB-ES-2018/faceduck/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UB-ES-2018/faceduck/labels{/name}","releases_url":"https://api.github.com/repos/UB-ES-2018/faceduck/releases{/id}","deployments_url":"https://api.github.com/repos/UB-ES-2018/faceduck/deployments","created_at":"2018-09-20T08:24:11Z","updated_at":"2018-10-19T14:05:17Z","pushed_at":"2018-10-20T11:06:20Z","git_url":"git://github.com/UB-ES-2018/faceduck.git","ssh_url":"git@github.com:UB-ES-2018/faceduck.git","clone_url":"https://github.com/UB-ES-2018/faceduck.git","svn_url":"https://github.com/UB-ES-2018/faceduck","homepage":null,"size":373,"stargazers_count":5,"watchers_count":5,"language":"Vue","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":11,"license":null,"forks":0,"open_issues":11,"watchers":5,"default_branch":"SP2"}},"_links":{"self":{"href":"https://api.github.com/repos/UB-ES-2018/faceduck/pulls/94"},"html":{"href":"https://github.com/UB-ES-2018/faceduck/pull/94"},"issue":{"href":"https://api.github.com/repos/UB-ES-2018/faceduck/issues/94"},"comments":{"href":"https://api.github.com/repos/UB-ES-2018/faceduck/issues/94/comments"},"review_comments":{"href":"https://api.github.com/repos/UB-ES-2018/faceduck/pulls/94/comments"},"review_comment":{"href":"https://api.github.com/repos/UB-ES-2018/faceduck/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UB-ES-2018/faceduck/pulls/94/commits"},"statuses":{"href":"https://api.github.com/repos/UB-ES-2018/faceduck/statuses/8fe465fd64ddcc878f03cb6f0413cd1189f5d955"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ifrins"}}