fix: 🐛 fixed bug that would cause driver view to contact vehicle endpoint and renamed driver type in vehicle view to be used properly
This commit is contained in:
@@ -19,7 +19,7 @@ export default defineComponent({
|
||||
headers.set('Content-Type', 'application/json')
|
||||
headers.set('Accept', 'application/json')
|
||||
|
||||
const request: RequestInfo = new Request("/vehicle", {
|
||||
const request: RequestInfo = new Request("http://localhost:5000/vehicle", {
|
||||
method:"GET",
|
||||
headers:headers
|
||||
})
|
||||
@@ -34,7 +34,7 @@ export default defineComponent({
|
||||
vehicleList.value.push({id: jsonBody[i]["id"], name: jsonBody[i]["name"]})
|
||||
}
|
||||
} else {
|
||||
alert(response.text)
|
||||
console.log(await response.text())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,9 +45,12 @@ export default defineComponent({
|
||||
headers.set('Content-Type', 'application/json')
|
||||
headers.set('Accept', 'application/json')
|
||||
|
||||
const request: RequestInfo = new Request("/vehicle", {
|
||||
const requestBody = JSON.stringify({ name: vehicleName.value });
|
||||
|
||||
const request: RequestInfo = new Request("http://localhost:5000/vehicle", {
|
||||
method:"POST",
|
||||
headers:headers
|
||||
headers:headers,
|
||||
body: requestBody
|
||||
})
|
||||
|
||||
var response = await fetch(request)
|
||||
@@ -56,7 +59,7 @@ export default defineComponent({
|
||||
var jsonBody = await response.json()
|
||||
vehicleList.value.push({id: jsonBody["body"], name: vehicleName.value})
|
||||
} else {
|
||||
alert(response.text)
|
||||
console.log(await response.text())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user