{"action":"created","comment":{"url":"https://api.github.com/repos/karibou-ch/kng2-core/pulls/comments/118305819","pull_request_review_id":40083824,"id":118305819,"diff_hunk":"@@ -307,9 +457,279 @@ export class UserService {\n     //   if([0,401].indexOf(error.status)!==-1){\n     //     self.copy(defaultUser);\n     //   }\n-    // }).$promise\n+    //\n     // );\n+\n   }\n-  \n+\n+  // app.get('/v1/users', auth.ensureAdmin, users.list);\n+  query(filter?: any): Observable<User[]> {\n+    filter = filter || {};\n+\n+    return this.http.get(this.config.API_SERVER + '/v1/users/', {\n+      search: filter,\n+      headers: this.headers,\n+      withCredentials: true\n+    })\n+      .map(res => res.json() as User[])\n+      .map(users => users.map(user => this.addCache(user)));\n+  }\n+\n+  // Reçoit un statut de requête http\n+  // app.get ('/v1/validate/:uid/:email', emails.validate);\n+  validate(id, email): Observable<any> {\n+    return this.http.get(this.config.API_SERVER + '/v1/validate/' + id + '/' + email, {\n+      headers: this.headers,\n+      withCredentials: true\n+    });\n+\n+  }\n+\n+  // app.post('/v1/validate/create',auth.ensureAuthenticated, emails.create);\n+  validateEmail(email): Observable<any> {\n+    return this.http.post(this.config.API_SERVER + '/v1/validate/create', email, {\n+      headers: this.headers,\n+      withCredentials: true\n+    });\n+  }\n+\n+  // app.post('/v1/recover/:token/:email/password', users.recover);\n+  recover(token, email, recover): Observable<any> {\n+    return this.http.post(this.config.API_SERVER + '/v1/recover/' + token + '/' + email + '/password', recover, {\n+      headers: this.headers,\n+      withCredentials: true\n+    });\n+  }\n+\n+\n+\n+  // app.post('/v1/users/:id', users.ensureMeOrAdmin,users.update);\n+  save(user): Observable<User> {\n+    // autofill the address name when available\n+    user.populateAdresseName();\n+    return this.http.post(this.config.API_SERVER + '/v1/users/' + user.id, user, {\n+      headers: this.headers,\n+      withCredentials: true\n+    })\n+      .map(res => res.json() as User)\n+      .catch(err => Observable.of(this.defaultUser));\n+\n+    // TODO inform consumers of user change\n+    // $rootScope.$broadcast(\"user.update\",_user);\n+\n+  }\n+\n+  // app.get ('/logout', auth.logout);\n+  logout(): Observable<User> {\n+    return this.http.get(this.config.API_SERVER + '/logout/', {\n+      headers: this.headers,\n+      withCredentials: true\n+    })\n+      .map(res => this.defaultUser as User)\n+      .catch(err => Observable.of(this.defaultUser));\n+    // TODO inform consumers of user change\n+    // $rootScope.$broadcast(\"user.update\",_user);\n+\n+  }\n+\n+  // TODO voir lignes commentées (updateGeoCode etc.)\n+  // app.post('/register', queued(auth.register_post));\n+  register(user): Observable<User> {\n+\n+    // FIXME autofill the address name when available\n+    user.populateAdresseName();\n+    return this.http.post(this.config.API_SERVER + '/register', user, {\n+      headers: this.headers,\n+      withCredentials: true\n+    })\n+      .map(res => res.json() as User)\n+      .catch(err => Observable.of(this.defaultUser));\n+    // _user.copy(u);\n+    // _user.updateGeoCode();\n+\n+  };\n+\n+  // app.post('/v1/users/:id/password',users.ensureMe, users.password);\n+  newpassword(id, change): Observable<any> {\n+    return this.http.post(this.config.API_SERVER + '/v1/users/' + id + '/password', change, {\n+      headers: this.headers,\n+      withCredentials: true\n+    });\n+  };\n+\n+  // TODO voir lignes commentées (updateGeoCode etc.) + Broadcast\n+  // app.post('/login', queued(auth.login_post));\n+  login(data): Observable<User> {\n+    return this.http.post(this.config.API_SERVER + '/login', data, {\n+      headers: this.headers,\n+      withCredentials: true\n+    })\n+      .map(res => res.json() as User)\n+      .catch(err => Observable.of(this.defaultUser));\n+    /*\n+    _user.copy(u);\n+    _user.updateGeoCode();\n+    $rootScope.$broadcast(\"user.init\",self);\n+    */\n+  };\n+\n+  //\n+  // TODO move this action to the shop service\n+  // app.post('/v1/shops', auth.ensureUserValid, shops.ensureShopLimit, shops.create);\n+  createShop(shop): Observable<Shop> {\n+    return this.http.post(this.config.API_SERVER + '/v1/shops', shop, {\n+      headers: this.headers,\n+      withCredentials: true\n+    })\n+      .map(res => res.json as Shop);\n+    // _user.shops.push(s);\n+\n+  };\n+\n+  // app.put('/v1/users/:id', auth.ensureAdmin, auth.checkPassword, users.remove);\n+  remove(id, password): Observable<any> {\n+    return this.http.put(this.config.API_SERVER + '/v1/users/', { password: password }, {\n+      headers: this.headers,\n+      withCredentials: true\n+    })\n+      .map(res => res.json() as User)\n+      .map(user => this.deleteCache(user));\n+    //self.delete();\n+    //$rootScope.$broadcast(\"user.remove\",self);\n+\n+  };\n+\n+  // app.post('/v1/users/:id/like/:sku', users.ensureMe, users.like);\n+  love(id, product): Observable<User> {\n+    //var self=this, params={};\n+    return this.http.post(this.config.API_SERVER + '/v1/users/' + id + '/like/' + product.sku, null, {\n+      headers: this.headers,\n+      withCredentials: true\n+    })\n+      .map(res => res.json() as User)\n+      .map(user => {\n+        this.cache.list.find(u => u.id === user.id).likes = user.likes.slice();","path":"module/user.service.ts","position":733,"original_position":733,"commit_id":"701c690f9622f98b95578bfaa3a96973f2141a8d","original_commit_id":"701c690f9622f98b95578bfaa3a96973f2141a8d","user":{"login":"evaletolab","id":1422935,"avatar_url":"https://avatars0.githubusercontent.com/u/1422935?v=3","gravatar_id":"","url":"https://api.github.com/users/evaletolab","html_url":"https://github.com/evaletolab","followers_url":"https://api.github.com/users/evaletolab/followers","following_url":"https://api.github.com/users/evaletolab/following{/other_user}","gists_url":"https://api.github.com/users/evaletolab/gists{/gist_id}","starred_url":"https://api.github.com/users/evaletolab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evaletolab/subscriptions","organizations_url":"https://api.github.com/users/evaletolab/orgs","repos_url":"https://api.github.com/users/evaletolab/repos","events_url":"https://api.github.com/users/evaletolab/events{/privacy}","received_events_url":"https://api.github.com/users/evaletolab/received_events","type":"User","site_admin":false},"body":"updateCache devrait être suffisant?","created_at":"2017-05-24T16:49:48Z","updated_at":"2017-05-24T16:50:33Z","html_url":"https://github.com/karibou-ch/kng2-core/pull/8#discussion_r118305819","pull_request_url":"https://api.github.com/repos/karibou-ch/kng2-core/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/karibou-ch/kng2-core/pulls/comments/118305819"},"html":{"href":"https://github.com/karibou-ch/kng2-core/pull/8#discussion_r118305819"},"pull_request":{"href":"https://api.github.com/repos/karibou-ch/kng2-core/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/karibou-ch/kng2-core/pulls/8","id":121515049,"html_url":"https://github.com/karibou-ch/kng2-core/pull/8","diff_url":"https://github.com/karibou-ch/kng2-core/pull/8.diff","patch_url":"https://github.com/karibou-ch/kng2-core/pull/8.patch","issue_url":"https://api.github.com/repos/karibou-ch/kng2-core/issues/8","number":8,"state":"open","locked":false,"title":"Dg user service","user":{"login":"GonzalD","id":22572442,"avatar_url":"https://avatars0.githubusercontent.com/u/22572442?v=3","gravatar_id":"","url":"https://api.github.com/users/GonzalD","html_url":"https://github.com/GonzalD","followers_url":"https://api.github.com/users/GonzalD/followers","following_url":"https://api.github.com/users/GonzalD/following{/other_user}","gists_url":"https://api.github.com/users/GonzalD/gists{/gist_id}","starred_url":"https://api.github.com/users/GonzalD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GonzalD/subscriptions","organizations_url":"https://api.github.com/users/GonzalD/orgs","repos_url":"https://api.github.com/users/GonzalD/repos","events_url":"https://api.github.com/users/GonzalD/events{/privacy}","received_events_url":"https://api.github.com/users/GonzalD/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-05-19T14:37:55Z","updated_at":"2017-05-24T16:50:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea31790168de1ceccd2f7ed222fa61eac099c140","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/karibou-ch/kng2-core/pulls/8/commits","review_comments_url":"https://api.github.com/repos/karibou-ch/kng2-core/pulls/8/comments","review_comment_url":"https://api.github.com/repos/karibou-ch/kng2-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/karibou-ch/kng2-core/issues/8/comments","statuses_url":"https://api.github.com/repos/karibou-ch/kng2-core/statuses/701c690f9622f98b95578bfaa3a96973f2141a8d","head":{"label":"karibou-ch:dg-user-service","ref":"dg-user-service","sha":"701c690f9622f98b95578bfaa3a96973f2141a8d","user":{"login":"karibou-ch","id":24863641,"avatar_url":"https://avatars3.githubusercontent.com/u/24863641?v=3","gravatar_id":"","url":"https://api.github.com/users/karibou-ch","html_url":"https://github.com/karibou-ch","followers_url":"https://api.github.com/users/karibou-ch/followers","following_url":"https://api.github.com/users/karibou-ch/following{/other_user}","gists_url":"https://api.github.com/users/karibou-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/karibou-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karibou-ch/subscriptions","organizations_url":"https://api.github.com/users/karibou-ch/orgs","repos_url":"https://api.github.com/users/karibou-ch/repos","events_url":"https://api.github.com/users/karibou-ch/events{/privacy}","received_events_url":"https://api.github.com/users/karibou-ch/received_events","type":"Organization","site_admin":false},"repo":{"id":88178360,"name":"kng2-core","full_name":"karibou-ch/kng2-core","owner":{"login":"karibou-ch","id":24863641,"avatar_url":"https://avatars3.githubusercontent.com/u/24863641?v=3","gravatar_id":"","url":"https://api.github.com/users/karibou-ch","html_url":"https://github.com/karibou-ch","followers_url":"https://api.github.com/users/karibou-ch/followers","following_url":"https://api.github.com/users/karibou-ch/following{/other_user}","gists_url":"https://api.github.com/users/karibou-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/karibou-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karibou-ch/subscriptions","organizations_url":"https://api.github.com/users/karibou-ch/orgs","repos_url":"https://api.github.com/users/karibou-ch/repos","events_url":"https://api.github.com/users/karibou-ch/events{/privacy}","received_events_url":"https://api.github.com/users/karibou-ch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/karibou-ch/kng2-core","description":"angular2 library that implement all core features of karibou.ch","fork":false,"url":"https://api.github.com/repos/karibou-ch/kng2-core","forks_url":"https://api.github.com/repos/karibou-ch/kng2-core/forks","keys_url":"https://api.github.com/repos/karibou-ch/kng2-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/karibou-ch/kng2-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/karibou-ch/kng2-core/teams","hooks_url":"https://api.github.com/repos/karibou-ch/kng2-core/hooks","issue_events_url":"https://api.github.com/repos/karibou-ch/kng2-core/issues/events{/number}","events_url":"https://api.github.com/repos/karibou-ch/kng2-core/events","assignees_url":"https://api.github.com/repos/karibou-ch/kng2-core/assignees{/user}","branches_url":"https://api.github.com/repos/karibou-ch/kng2-core/branches{/branch}","tags_url":"https://api.github.com/repos/karibou-ch/kng2-core/tags","blobs_url":"https://api.github.com/repos/karibou-ch/kng2-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/karibou-ch/kng2-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/karibou-ch/kng2-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/karibou-ch/kng2-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/karibou-ch/kng2-core/statuses/{sha}","languages_url":"https://api.github.com/repos/karibou-ch/kng2-core/languages","stargazers_url":"https://api.github.com/repos/karibou-ch/kng2-core/stargazers","contributors_url":"https://api.github.com/repos/karibou-ch/kng2-core/contributors","subscribers_url":"https://api.github.com/repos/karibou-ch/kng2-core/subscribers","subscription_url":"https://api.github.com/repos/karibou-ch/kng2-core/subscription","commits_url":"https://api.github.com/repos/karibou-ch/kng2-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/karibou-ch/kng2-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/karibou-ch/kng2-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/karibou-ch/kng2-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/karibou-ch/kng2-core/contents/{+path}","compare_url":"https://api.github.com/repos/karibou-ch/kng2-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/karibou-ch/kng2-core/merges","archive_url":"https://api.github.com/repos/karibou-ch/kng2-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/karibou-ch/kng2-core/downloads","issues_url":"https://api.github.com/repos/karibou-ch/kng2-core/issues{/number}","pulls_url":"https://api.github.com/repos/karibou-ch/kng2-core/pulls{/number}","milestones_url":"https://api.github.com/repos/karibou-ch/kng2-core/milestones{/number}","notifications_url":"https://api.github.com/repos/karibou-ch/kng2-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/karibou-ch/kng2-core/labels{/name}","releases_url":"https://api.github.com/repos/karibou-ch/kng2-core/releases{/id}","deployments_url":"https://api.github.com/repos/karibou-ch/kng2-core/deployments","created_at":"2017-04-13T15:15:18Z","updated_at":"2017-05-20T11:09:35Z","pushed_at":"2017-05-24T16:39:34Z","git_url":"git://github.com/karibou-ch/kng2-core.git","ssh_url":"git@github.com:karibou-ch/kng2-core.git","clone_url":"https://github.com/karibou-ch/kng2-core.git","svn_url":"https://github.com/karibou-ch/kng2-core","homepage":"","size":50,"stargazers_count":1,"watchers_count":1,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"karibou-ch:master","ref":"master","sha":"38984456e990cb98ea0d3dcff2afaa94ce0cc950","user":{"login":"karibou-ch","id":24863641,"avatar_url":"https://avatars3.githubusercontent.com/u/24863641?v=3","gravatar_id":"","url":"https://api.github.com/users/karibou-ch","html_url":"https://github.com/karibou-ch","followers_url":"https://api.github.com/users/karibou-ch/followers","following_url":"https://api.github.com/users/karibou-ch/following{/other_user}","gists_url":"https://api.github.com/users/karibou-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/karibou-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karibou-ch/subscriptions","organizations_url":"https://api.github.com/users/karibou-ch/orgs","repos_url":"https://api.github.com/users/karibou-ch/repos","events_url":"https://api.github.com/users/karibou-ch/events{/privacy}","received_events_url":"https://api.github.com/users/karibou-ch/received_events","type":"Organization","site_admin":false},"repo":{"id":88178360,"name":"kng2-core","full_name":"karibou-ch/kng2-core","owner":{"login":"karibou-ch","id":24863641,"avatar_url":"https://avatars3.githubusercontent.com/u/24863641?v=3","gravatar_id":"","url":"https://api.github.com/users/karibou-ch","html_url":"https://github.com/karibou-ch","followers_url":"https://api.github.com/users/karibou-ch/followers","following_url":"https://api.github.com/users/karibou-ch/following{/other_user}","gists_url":"https://api.github.com/users/karibou-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/karibou-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karibou-ch/subscriptions","organizations_url":"https://api.github.com/users/karibou-ch/orgs","repos_url":"https://api.github.com/users/karibou-ch/repos","events_url":"https://api.github.com/users/karibou-ch/events{/privacy}","received_events_url":"https://api.github.com/users/karibou-ch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/karibou-ch/kng2-core","description":"angular2 library that implement all core features of karibou.ch","fork":false,"url":"https://api.github.com/repos/karibou-ch/kng2-core","forks_url":"https://api.github.com/repos/karibou-ch/kng2-core/forks","keys_url":"https://api.github.com/repos/karibou-ch/kng2-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/karibou-ch/kng2-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/karibou-ch/kng2-core/teams","hooks_url":"https://api.github.com/repos/karibou-ch/kng2-core/hooks","issue_events_url":"https://api.github.com/repos/karibou-ch/kng2-core/issues/events{/number}","events_url":"https://api.github.com/repos/karibou-ch/kng2-core/events","assignees_url":"https://api.github.com/repos/karibou-ch/kng2-core/assignees{/user}","branches_url":"https://api.github.com/repos/karibou-ch/kng2-core/branches{/branch}","tags_url":"https://api.github.com/repos/karibou-ch/kng2-core/tags","blobs_url":"https://api.github.com/repos/karibou-ch/kng2-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/karibou-ch/kng2-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/karibou-ch/kng2-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/karibou-ch/kng2-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/karibou-ch/kng2-core/statuses/{sha}","languages_url":"https://api.github.com/repos/karibou-ch/kng2-core/languages","stargazers_url":"https://api.github.com/repos/karibou-ch/kng2-core/stargazers","contributors_url":"https://api.github.com/repos/karibou-ch/kng2-core/contributors","subscribers_url":"https://api.github.com/repos/karibou-ch/kng2-core/subscribers","subscription_url":"https://api.github.com/repos/karibou-ch/kng2-core/subscription","commits_url":"https://api.github.com/repos/karibou-ch/kng2-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/karibou-ch/kng2-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/karibou-ch/kng2-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/karibou-ch/kng2-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/karibou-ch/kng2-core/contents/{+path}","compare_url":"https://api.github.com/repos/karibou-ch/kng2-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/karibou-ch/kng2-core/merges","archive_url":"https://api.github.com/repos/karibou-ch/kng2-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/karibou-ch/kng2-core/downloads","issues_url":"https://api.github.com/repos/karibou-ch/kng2-core/issues{/number}","pulls_url":"https://api.github.com/repos/karibou-ch/kng2-core/pulls{/number}","milestones_url":"https://api.github.com/repos/karibou-ch/kng2-core/milestones{/number}","notifications_url":"https://api.github.com/repos/karibou-ch/kng2-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/karibou-ch/kng2-core/labels{/name}","releases_url":"https://api.github.com/repos/karibou-ch/kng2-core/releases{/id}","deployments_url":"https://api.github.com/repos/karibou-ch/kng2-core/deployments","created_at":"2017-04-13T15:15:18Z","updated_at":"2017-05-20T11:09:35Z","pushed_at":"2017-05-24T16:39:34Z","git_url":"git://github.com/karibou-ch/kng2-core.git","ssh_url":"git@github.com:karibou-ch/kng2-core.git","clone_url":"https://github.com/karibou-ch/kng2-core.git","svn_url":"https://github.com/karibou-ch/kng2-core","homepage":"","size":50,"stargazers_count":1,"watchers_count":1,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/karibou-ch/kng2-core/pulls/8"},"html":{"href":"https://github.com/karibou-ch/kng2-core/pull/8"},"issue":{"href":"https://api.github.com/repos/karibou-ch/kng2-core/issues/8"},"comments":{"href":"https://api.github.com/repos/karibou-ch/kng2-core/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/karibou-ch/kng2-core/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/karibou-ch/kng2-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/karibou-ch/kng2-core/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/karibou-ch/kng2-core/statuses/701c690f9622f98b95578bfaa3a96973f2141a8d"}}}}
{"actor":{"display_login":"evaletolab"}}