Skip to content
Snippets Groups Projects
Commit 24215de9 authored by Daniel's avatar Daniel
Browse files

WebApp: converse.js: Adapt with new API routes

parent def22a7b
No related merge requests found
......@@ -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
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment