diff --git a/TugasBesar2_2017/WebApp/src/main/webapp/js/converse.js b/TugasBesar2_2017/WebApp/src/main/webapp/js/converse.js index ce42c4659b6c5516a79f400544d4aab03094abca..eee6237eb2fa4169103aba95aa61bdc279070988 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