From 24215de9ac6fed3de6ffc3132e67e69f4fe2e2ed Mon Sep 17 00:00:00 2001
From: Daniel <nieltansah@gmail.com>
Date: Thu, 23 Nov 2017 23:07:58 +0700
Subject: [PATCH] WebApp: converse.js: Adapt with new API routes

---
 .../WebApp/src/main/webapp/js/converse.js            | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/TugasBesar2_2017/WebApp/src/main/webapp/js/converse.js b/TugasBesar2_2017/WebApp/src/main/webapp/js/converse.js
index ce42c46..eee6237 100644
--- a/TugasBesar2_2017/WebApp/src/main/webapp/js/converse.js
+++ b/TugasBesar2_2017/WebApp/src/main/webapp/js/converse.js
@@ -42,7 +42,7 @@ let converse = function ($http) {
         })
 
         console.log(data)
-        await $http.post(`${apiUrl}/chat/${this.id}/token`, data)
+        await $http.post(`${apiUrl}/driver/${this.id}/chat/init`, data)
       } catch (e) {
         console.log(e)
         alert('Unable to initialize chat service.')
@@ -54,13 +54,13 @@ let converse = function ($http) {
         'message': message
       })
 
-      return $http.post(`${apiUrl}/chat/${this.id}`, data)
+      return $http.post(`${apiUrl}/driver/${this.id}/chat`, data)
     }
   }
 
   class Driver extends Account {
     async waitAsync (locations, timeout) {
-      let response = await $http.post(`${apiUrl}/driver/${this.id}`, null, {
+      let response = await $http.post(`${apiUrl}/driver/${this.id}/wait`, null, {
         timeout: timeout
       })
 
@@ -69,12 +69,6 @@ let converse = function ($http) {
   }
 
   class User extends Account {
-    async listAsync (location) {
-      let response = await $http.get(`${apiUrl}/driver/find?location=${location}`)
-
-      return response.data.driver_ids
-    }
-
     pickAsync (id) {
       let data = JSON.stringify({
         'user_id': id
-- 
GitLab