preliminary map for vehicles

This commit is contained in:
Drew Taylor
2021-07-14 10:12:59 -07:00
parent ab37cd598f
commit c0a11de056
9 changed files with 257 additions and 180 deletions

View File

@@ -6,24 +6,24 @@ const clientToken = 'pubeb25449bb91773fc993855c7378e375a';
const site = 'datadoghq.com';
const service = 'ota-portal';
datadogRum.init({
applicationId,
clientToken,
site,
service,
// Specify a version number to identify the deployed version of your application in Datadog
// version: '1.0.0',
sampleRate: 100,
trackInteractions: true
});
// datadogRum.init({
// applicationId,
// clientToken,
// site,
// service,
// // Specify a version number to identify the deployed version of your application in Datadog
// // version: '1.0.0',
// sampleRate: 100,
// trackInteractions: true
// });
datadogLogs.init({
clientToken,
site,
service,
forwardErrorsToLogs: true,
sampleRate: 100,
});
// datadogLogs.init({
// clientToken,
// site,
// service,
// forwardErrorsToLogs: true,
// sampleRate: 100,
// });
const logger = datadogLogs.logger;

View File

@@ -9,10 +9,10 @@ const vehiclesAPI = {
body: JSON.stringify(vehicle),
})
.then(fetchRespHandler),
getVehicles: async (search, token) => {
const u = addQueryParams(`${API_ENDPOINT}/vehicles`, search);
return fetch(u, {
return fetch(u, {
method: "GET",
headers: Object.assign({ "Content-Type": "application/json" }, getAuthHeaderOptions(token)),
})
@@ -20,10 +20,10 @@ const vehiclesAPI = {
},
getModels: async (token) => fetch(`${API_ENDPOINT}/vehiclemodels`, {
method: "GET",
headers: Object.assign({ "Content-Type": "application/json" }, getAuthHeaderOptions(token)),
})
.then(fetchRespHandler),
method: "GET",
headers: Object.assign({ "Content-Type": "application/json" }, getAuthHeaderOptions(token)),
})
.then(fetchRespHandler),
getYears: async (token) => fetch(`${API_ENDPOINT}/vehicleyears`, {
method: "GET",
@@ -39,15 +39,22 @@ const vehiclesAPI = {
}),
})
.then(fetchRespHandler),
getConnections: async (vins, token) => {
const u = `${API_ENDPOINT}/carsconnected?vins=${vins.join(",")}`
return fetch(u, {
return fetch(u, {
method: "GET",
headers: Object.assign({ "Content-Type": "application/json" }, getAuthHeaderOptions(token)),
})
.then(fetchRespHandler)
},
getLocations: async (token) => fetch(`${API_ENDPOINT}/carslocations`, {
method: "GET",
headers: Object.assign({ "Content-Type": "application/json" }, getAuthHeaderOptions(token)),
})
.then(fetchRespHandler),
};
export default vehiclesAPI;