{"action":"created","comment":{"url":"https://api.github.com/repos/excellencetechnologies/xsmart/pulls/comments/219771061","pull_request_review_id":158021824,"id":219771061,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTc3MTA2MQ==","diff_hunk":"@@ -46,74 +48,81 @@ export class ApiService {\n   async setWifiPassword(ssid, password) {\n     // return await this.http.get<Wifi[]>(this.base_url + \"wifisave?SSID=\" + ssid + \"&password=\" + password).toPromise();\n     try {\n-      const data = await this.http.get(`${environment[\"apiBase\"]}deviceSimulator/setWifiPassword/${ssid}/${password}`).toPromise();\n-      return data['data'];\n+      return await this.http.get<Wifi[]>(`${environment[\"deviceUrl\"]}wifisave?ssid=${ssid}&password=${password}`).toPromise();\n+\n     }\n     catch (error) {\n       throw (error);\n     }\n   }\n-\n   async setDeviceNickName(name: String, chip: string) {\n     // return await this.http.get<Wifi[]>(this.base_url + \"setnickname?name=\" + name).toPromise();\n     try {\n-      const data = await this.http.get(`${environment[\"apiBase\"]}deviceSimulator/setDeviceNickName/${name}/${chip}`).toPromise();\n-      console.log(data);\n-\n-      return data['data'];\n+      return await this.http.get(`${environment[\"deviceUrl\"]}setnickname?name=${name}&chip=${chip}`).toPromise();\n     }\n     catch (error) {\n       throw (error);\n     }\n   }\n \n-  async postlogin(data) {\n-    const apidata = { \"email\": data.email, \"password\": data.password };\n+  async postlogin(user:User) {\n+    const apidata = { \"email\": user.email, \"password\": user.password };\n     try {\n-      const data = await this.http.post(`${environment[\"apiBase\"]}user/login`, apidata).toPromise();\n+      const data = await this.http.post<User>(`${environment[\"base_url\"]}user/login`, apidata).toPromise();\n       localStorage.setItem(\"token\", data['token']);\n-      localStorage.setItem(\"username\", data[\"data\"].name);\n-      localStorage.setItem(\"userId\", data[\"data\"]._id); \n-      return data['data'];\n+      localStorage.setItem(\"username\", data[\"name\"]);\n+      localStorage.setItem(\"userId\", data[\"_id\"]);\n+      return data;\n     }\n     catch (error) {\n       throw (error);\n     }\n   }\n-  async postRegister(data) {\n-    const apidata = { \"name\": data.name, \"email\": data.email, \"password\": data.password };\n+  async postRegister(user:User) {\n+    const apidata = { \"name\": user.name, \"email\": user.email, \"password\": user.password };\n     try {\n-      const data = await this.http.post(`${environment[\"apiBase\"]}user/register`, apidata).toPromise();\n-      return data['data'];\n+      return await this.http.post<User>(`${environment[\"base_url\"]}user/register`, apidata).toPromise();\n+\n     }\n     catch (error) {\n       throw (error);\n     }\n   }\n-  async deviceList() {\n+  async addDevices(body) {\n+    let header = new HttpHeaders().set('token', localStorage.getItem(\"token\"));\n     try {\n-      const data = await this.http.get(`${environment[\"apiBase\"]}device/listDevice`, this.httpOptions).toPromise();\n-      return data['devices'];\n-\n+      return await this.http.post(`${environment[\"base_url\"]}device/addDevice`, body,\n+        {\n+          headers: header\n+        }\n+      ).toPromise();\n \n     }\n     catch (error) {\n       throw (error);\n     }\n   }\n-  async addDevices(body) {\n+  async listDevices() {","path":"ionic/src/app/api/api.service.ts","position":119,"original_position":119,"commit_id":"b03bdad918a18b9209467fc1c8e9c855326574a7","original_commit_id":"b03bdad918a18b9209467fc1c8e9c855326574a7","user":{"login":"excellencetechnologies","id":956347,"node_id":"MDQ6VXNlcjk1NjM0Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/956347?v=4","gravatar_id":"","url":"https://api.github.com/users/excellencetechnologies","html_url":"https://github.com/excellencetechnologies","followers_url":"https://api.github.com/users/excellencetechnologies/followers","following_url":"https://api.github.com/users/excellencetechnologies/following{/other_user}","gists_url":"https://api.github.com/users/excellencetechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/excellencetechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/excellencetechnologies/subscriptions","organizations_url":"https://api.github.com/users/excellencetechnologies/orgs","repos_url":"https://api.github.com/users/excellencetechnologies/repos","events_url":"https://api.github.com/users/excellencetechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/excellencetechnologies/received_events","type":"User","site_admin":false},"body":"trype script missing","created_at":"2018-09-24T09:12:39Z","updated_at":"2018-09-24T09:13:45Z","html_url":"https://github.com/excellencetechnologies/xsmart/pull/35#discussion_r219771061","pull_request_url":"https://api.github.com/repos/excellencetechnologies/xsmart/pulls/35","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/excellencetechnologies/xsmart/pulls/comments/219771061"},"html":{"href":"https://github.com/excellencetechnologies/xsmart/pull/35#discussion_r219771061"},"pull_request":{"href":"https://api.github.com/repos/excellencetechnologies/xsmart/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/excellencetechnologies/xsmart/pulls/35","id":216652222,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2NjUyMjIy","html_url":"https://github.com/excellencetechnologies/xsmart/pull/35","diff_url":"https://github.com/excellencetechnologies/xsmart/pull/35.diff","patch_url":"https://github.com/excellencetechnologies/xsmart/pull/35.patch","issue_url":"https://api.github.com/repos/excellencetechnologies/xsmart/issues/35","number":35,"state":"open","locked":false,"title":"accessControl","user":{"login":"excellencetechnologies","id":956347,"node_id":"MDQ6VXNlcjk1NjM0Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/956347?v=4","gravatar_id":"","url":"https://api.github.com/users/excellencetechnologies","html_url":"https://github.com/excellencetechnologies","followers_url":"https://api.github.com/users/excellencetechnologies/followers","following_url":"https://api.github.com/users/excellencetechnologies/following{/other_user}","gists_url":"https://api.github.com/users/excellencetechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/excellencetechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/excellencetechnologies/subscriptions","organizations_url":"https://api.github.com/users/excellencetechnologies/orgs","repos_url":"https://api.github.com/users/excellencetechnologies/repos","events_url":"https://api.github.com/users/excellencetechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/excellencetechnologies/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-19T14:04:39Z","updated_at":"2018-09-24T09:13:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8be3e65d4548edf00e0df5fbc0ee55b36b34487e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/excellencetechnologies/xsmart/pulls/35/commits","review_comments_url":"https://api.github.com/repos/excellencetechnologies/xsmart/pulls/35/comments","review_comment_url":"https://api.github.com/repos/excellencetechnologies/xsmart/pulls/comments{/number}","comments_url":"https://api.github.com/repos/excellencetechnologies/xsmart/issues/35/comments","statuses_url":"https://api.github.com/repos/excellencetechnologies/xsmart/statuses/b03bdad918a18b9209467fc1c8e9c855326574a7","head":{"label":"excellencetechnologies:accessControl","ref":"accessControl","sha":"b03bdad918a18b9209467fc1c8e9c855326574a7","user":{"login":"excellencetechnologies","id":956347,"node_id":"MDQ6VXNlcjk1NjM0Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/956347?v=4","gravatar_id":"","url":"https://api.github.com/users/excellencetechnologies","html_url":"https://github.com/excellencetechnologies","followers_url":"https://api.github.com/users/excellencetechnologies/followers","following_url":"https://api.github.com/users/excellencetechnologies/following{/other_user}","gists_url":"https://api.github.com/users/excellencetechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/excellencetechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/excellencetechnologies/subscriptions","organizations_url":"https://api.github.com/users/excellencetechnologies/orgs","repos_url":"https://api.github.com/users/excellencetechnologies/repos","events_url":"https://api.github.com/users/excellencetechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/excellencetechnologies/received_events","type":"User","site_admin":false},"repo":{"id":143550827,"node_id":"MDEwOlJlcG9zaXRvcnkxNDM1NTA4Mjc=","name":"xsmart","full_name":"excellencetechnologies/xsmart","private":false,"owner":{"login":"excellencetechnologies","id":956347,"node_id":"MDQ6VXNlcjk1NjM0Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/956347?v=4","gravatar_id":"","url":"https://api.github.com/users/excellencetechnologies","html_url":"https://github.com/excellencetechnologies","followers_url":"https://api.github.com/users/excellencetechnologies/followers","following_url":"https://api.github.com/users/excellencetechnologies/following{/other_user}","gists_url":"https://api.github.com/users/excellencetechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/excellencetechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/excellencetechnologies/subscriptions","organizations_url":"https://api.github.com/users/excellencetechnologies/orgs","repos_url":"https://api.github.com/users/excellencetechnologies/repos","events_url":"https://api.github.com/users/excellencetechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/excellencetechnologies/received_events","type":"User","site_admin":false},"html_url":"https://github.com/excellencetechnologies/xsmart","description":null,"fork":false,"url":"https://api.github.com/repos/excellencetechnologies/xsmart","forks_url":"https://api.github.com/repos/excellencetechnologies/xsmart/forks","keys_url":"https://api.github.com/repos/excellencetechnologies/xsmart/keys{/key_id}","collaborators_url":"https://api.github.com/repos/excellencetechnologies/xsmart/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/excellencetechnologies/xsmart/teams","hooks_url":"https://api.github.com/repos/excellencetechnologies/xsmart/hooks","issue_events_url":"https://api.github.com/repos/excellencetechnologies/xsmart/issues/events{/number}","events_url":"https://api.github.com/repos/excellencetechnologies/xsmart/events","assignees_url":"https://api.github.com/repos/excellencetechnologies/xsmart/assignees{/user}","branches_url":"https://api.github.com/repos/excellencetechnologies/xsmart/branches{/branch}","tags_url":"https://api.github.com/repos/excellencetechnologies/xsmart/tags","blobs_url":"https://api.github.com/repos/excellencetechnologies/xsmart/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/excellencetechnologies/xsmart/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/excellencetechnologies/xsmart/git/refs{/sha}","trees_url":"https://api.github.com/repos/excellencetechnologies/xsmart/git/trees{/sha}","statuses_url":"https://api.github.com/repos/excellencetechnologies/xsmart/statuses/{sha}","languages_url":"https://api.github.com/repos/excellencetechnologies/xsmart/languages","stargazers_url":"https://api.github.com/repos/excellencetechnologies/xsmart/stargazers","contributors_url":"https://api.github.com/repos/excellencetechnologies/xsmart/contributors","subscribers_url":"https://api.github.com/repos/excellencetechnologies/xsmart/subscribers","subscription_url":"https://api.github.com/repos/excellencetechnologies/xsmart/subscription","commits_url":"https://api.github.com/repos/excellencetechnologies/xsmart/commits{/sha}","git_commits_url":"https://api.github.com/repos/excellencetechnologies/xsmart/git/commits{/sha}","comments_url":"https://api.github.com/repos/excellencetechnologies/xsmart/comments{/number}","issue_comment_url":"https://api.github.com/repos/excellencetechnologies/xsmart/issues/comments{/number}","contents_url":"https://api.github.com/repos/excellencetechnologies/xsmart/contents/{+path}","compare_url":"https://api.github.com/repos/excellencetechnologies/xsmart/compare/{base}...{head}","merges_url":"https://api.github.com/repos/excellencetechnologies/xsmart/merges","archive_url":"https://api.github.com/repos/excellencetechnologies/xsmart/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/excellencetechnologies/xsmart/downloads","issues_url":"https://api.github.com/repos/excellencetechnologies/xsmart/issues{/number}","pulls_url":"https://api.github.com/repos/excellencetechnologies/xsmart/pulls{/number}","milestones_url":"https://api.github.com/repos/excellencetechnologies/xsmart/milestones{/number}","notifications_url":"https://api.github.com/repos/excellencetechnologies/xsmart/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/excellencetechnologies/xsmart/labels{/name}","releases_url":"https://api.github.com/repos/excellencetechnologies/xsmart/releases{/id}","deployments_url":"https://api.github.com/repos/excellencetechnologies/xsmart/deployments","created_at":"2018-08-04T17:56:56Z","updated_at":"2018-09-15T02:43:31Z","pushed_at":"2018-09-24T09:03:29Z","git_url":"git://github.com/excellencetechnologies/xsmart.git","ssh_url":"git@github.com:excellencetechnologies/xsmart.git","clone_url":"https://github.com/excellencetechnologies/xsmart.git","svn_url":"https://github.com/excellencetechnologies/xsmart","homepage":null,"size":5671,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","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":17,"license":null,"forks":0,"open_issues":17,"watchers":0,"default_branch":"master"}},"base":{"label":"excellencetechnologies:development","ref":"development","sha":"a727f80a4abdd2aa409dba77c41ed147965a6dba","user":{"login":"excellencetechnologies","id":956347,"node_id":"MDQ6VXNlcjk1NjM0Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/956347?v=4","gravatar_id":"","url":"https://api.github.com/users/excellencetechnologies","html_url":"https://github.com/excellencetechnologies","followers_url":"https://api.github.com/users/excellencetechnologies/followers","following_url":"https://api.github.com/users/excellencetechnologies/following{/other_user}","gists_url":"https://api.github.com/users/excellencetechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/excellencetechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/excellencetechnologies/subscriptions","organizations_url":"https://api.github.com/users/excellencetechnologies/orgs","repos_url":"https://api.github.com/users/excellencetechnologies/repos","events_url":"https://api.github.com/users/excellencetechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/excellencetechnologies/received_events","type":"User","site_admin":false},"repo":{"id":143550827,"node_id":"MDEwOlJlcG9zaXRvcnkxNDM1NTA4Mjc=","name":"xsmart","full_name":"excellencetechnologies/xsmart","private":false,"owner":{"login":"excellencetechnologies","id":956347,"node_id":"MDQ6VXNlcjk1NjM0Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/956347?v=4","gravatar_id":"","url":"https://api.github.com/users/excellencetechnologies","html_url":"https://github.com/excellencetechnologies","followers_url":"https://api.github.com/users/excellencetechnologies/followers","following_url":"https://api.github.com/users/excellencetechnologies/following{/other_user}","gists_url":"https://api.github.com/users/excellencetechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/excellencetechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/excellencetechnologies/subscriptions","organizations_url":"https://api.github.com/users/excellencetechnologies/orgs","repos_url":"https://api.github.com/users/excellencetechnologies/repos","events_url":"https://api.github.com/users/excellencetechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/excellencetechnologies/received_events","type":"User","site_admin":false},"html_url":"https://github.com/excellencetechnologies/xsmart","description":null,"fork":false,"url":"https://api.github.com/repos/excellencetechnologies/xsmart","forks_url":"https://api.github.com/repos/excellencetechnologies/xsmart/forks","keys_url":"https://api.github.com/repos/excellencetechnologies/xsmart/keys{/key_id}","collaborators_url":"https://api.github.com/repos/excellencetechnologies/xsmart/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/excellencetechnologies/xsmart/teams","hooks_url":"https://api.github.com/repos/excellencetechnologies/xsmart/hooks","issue_events_url":"https://api.github.com/repos/excellencetechnologies/xsmart/issues/events{/number}","events_url":"https://api.github.com/repos/excellencetechnologies/xsmart/events","assignees_url":"https://api.github.com/repos/excellencetechnologies/xsmart/assignees{/user}","branches_url":"https://api.github.com/repos/excellencetechnologies/xsmart/branches{/branch}","tags_url":"https://api.github.com/repos/excellencetechnologies/xsmart/tags","blobs_url":"https://api.github.com/repos/excellencetechnologies/xsmart/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/excellencetechnologies/xsmart/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/excellencetechnologies/xsmart/git/refs{/sha}","trees_url":"https://api.github.com/repos/excellencetechnologies/xsmart/git/trees{/sha}","statuses_url":"https://api.github.com/repos/excellencetechnologies/xsmart/statuses/{sha}","languages_url":"https://api.github.com/repos/excellencetechnologies/xsmart/languages","stargazers_url":"https://api.github.com/repos/excellencetechnologies/xsmart/stargazers","contributors_url":"https://api.github.com/repos/excellencetechnologies/xsmart/contributors","subscribers_url":"https://api.github.com/repos/excellencetechnologies/xsmart/subscribers","subscription_url":"https://api.github.com/repos/excellencetechnologies/xsmart/subscription","commits_url":"https://api.github.com/repos/excellencetechnologies/xsmart/commits{/sha}","git_commits_url":"https://api.github.com/repos/excellencetechnologies/xsmart/git/commits{/sha}","comments_url":"https://api.github.com/repos/excellencetechnologies/xsmart/comments{/number}","issue_comment_url":"https://api.github.com/repos/excellencetechnologies/xsmart/issues/comments{/number}","contents_url":"https://api.github.com/repos/excellencetechnologies/xsmart/contents/{+path}","compare_url":"https://api.github.com/repos/excellencetechnologies/xsmart/compare/{base}...{head}","merges_url":"https://api.github.com/repos/excellencetechnologies/xsmart/merges","archive_url":"https://api.github.com/repos/excellencetechnologies/xsmart/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/excellencetechnologies/xsmart/downloads","issues_url":"https://api.github.com/repos/excellencetechnologies/xsmart/issues{/number}","pulls_url":"https://api.github.com/repos/excellencetechnologies/xsmart/pulls{/number}","milestones_url":"https://api.github.com/repos/excellencetechnologies/xsmart/milestones{/number}","notifications_url":"https://api.github.com/repos/excellencetechnologies/xsmart/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/excellencetechnologies/xsmart/labels{/name}","releases_url":"https://api.github.com/repos/excellencetechnologies/xsmart/releases{/id}","deployments_url":"https://api.github.com/repos/excellencetechnologies/xsmart/deployments","created_at":"2018-08-04T17:56:56Z","updated_at":"2018-09-15T02:43:31Z","pushed_at":"2018-09-24T09:03:29Z","git_url":"git://github.com/excellencetechnologies/xsmart.git","ssh_url":"git@github.com:excellencetechnologies/xsmart.git","clone_url":"https://github.com/excellencetechnologies/xsmart.git","svn_url":"https://github.com/excellencetechnologies/xsmart","homepage":null,"size":5671,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","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":17,"license":null,"forks":0,"open_issues":17,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/excellencetechnologies/xsmart/pulls/35"},"html":{"href":"https://github.com/excellencetechnologies/xsmart/pull/35"},"issue":{"href":"https://api.github.com/repos/excellencetechnologies/xsmart/issues/35"},"comments":{"href":"https://api.github.com/repos/excellencetechnologies/xsmart/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/excellencetechnologies/xsmart/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/excellencetechnologies/xsmart/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/excellencetechnologies/xsmart/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/excellencetechnologies/xsmart/statuses/b03bdad918a18b9209467fc1c8e9c855326574a7"}},"author_association":"OWNER"}}
{"actor":{"display_login":"excellencetechnologies"}}