From faf0d7e75a0c0abb357185ce1d298a006761af1d Mon Sep 17 00:00:00 2001 From: jwu-fisker Date: Mon, 12 Jun 2023 20:24:21 -0700 Subject: [PATCH] Merge branch 'release/0.9.0' --- .env.cec-euprd | 1 + .env.cec-prd | 1 + .env.dev | 1 + .env.local | 1 + .env.prd | 1 + .env.stg | 1 + .../App/__snapshots__/App.test.js.snap | 101 ++- .../__snapshots__/index.test.jsx.snap | 41 + .../CANSelfServe/SelfServe/index.jsx | 28 +- .../Details/__snapshots__/index.test.jsx.snap | 37 + src/components/Cars/Status/Details/index.jsx | 21 +- .../__snapshots__/DetailsTab.test.jsx.snap | 37 + .../DigitalTwinTab.test.jsx.snap | 8 +- .../Status/__snapshots__/index.test.jsx.snap | 37 + src/components/Cars/Status/index.jsx | 1 + .../Update/__snapshots__/index.test.jsx.snap | 38 + src/components/Cars/Update/index.jsx | 33 +- src/components/Contexts/VehicleContext.jsx | 4 +- .../Contexts/__mocks__/VehicleContext.jsx | 1 + .../__snapshots__/index.test.jsx.snap | 716 ++++++++++++++++++ .../DTCTimeline/DTCTimeline/index.jsx | 192 +++-- .../DTCTimeline/DTCTimeline/index.test.jsx | 42 + src/components/DigitalTwin/index.js | 10 +- src/components/Layouts/MenuDrawer.jsx | 2 +- src/components/useStyles.jsx | 3 +- src/services/vehiclesAPI.js | 4 +- 26 files changed, 1238 insertions(+), 124 deletions(-) create mode 100644 src/components/DTCTimeline/DTCTimeline/__snapshots__/index.test.jsx.snap create mode 100644 src/components/DTCTimeline/DTCTimeline/index.test.jsx diff --git a/.env.cec-euprd b/.env.cec-euprd index 7b9dcef..74cb850 100644 --- a/.env.cec-euprd +++ b/.env.cec-euprd @@ -17,3 +17,4 @@ REACT_APP_ROLE_SUPPLIER_APPROVER=a6c9805e-80b2-42b2-bfbb-9df52e5504d8 REACT_APP_ROLE_MANIFEST_MIGRATION=42798c8a-9fa7-4fb4-82c0-9582cabe364f REACT_APP_ECCKEY_ENV= REACT_APP_HOME_MAP_DEFAULT_LOCATION={"lat":49.8327,"lng":9.8816,"zoom":4.5} +REACT_APP_ENABLE_DEBUGMASK=1 \ No newline at end of file diff --git a/.env.cec-prd b/.env.cec-prd index d30b7e4..074549f 100644 --- a/.env.cec-prd +++ b/.env.cec-prd @@ -17,3 +17,4 @@ REACT_APP_ROLE_SUPPLIER_APPROVER=a6c9805e-80b2-42b2-bfbb-9df52e5504d8 REACT_APP_ROLE_MANIFEST_MIGRATION=42798c8a-9fa7-4fb4-82c0-9582cabe364f REACT_APP_ECCKEY_ENV= REACT_APP_HOME_MAP_DEFAULT_LOCATION={"lat":37.0902,"lng":-95.7129,"zoom":4.5} +REACT_APP_ENABLE_DEBUGMASK=1 \ No newline at end of file diff --git a/.env.dev b/.env.dev index a04f46a..7fdf5cb 100644 --- a/.env.dev +++ b/.env.dev @@ -17,3 +17,4 @@ REACT_APP_ROLE_SUPPLIER_APPROVER=a6c9805e-80b2-42b2-bfbb-9df52e5504d8 REACT_APP_ROLE_MANIFEST_MIGRATION=42798c8a-9fa7-4fb4-82c0-9582cabe364f REACT_APP_ECCKEY_ENV=stage,prod REACT_APP_HOME_MAP_DEFAULT_LOCATION={"lat":37.0902,"lng":-95.7129,"zoom":4.5} +REACT_APP_ENABLE_DEBUGMASK=1 \ No newline at end of file diff --git a/.env.local b/.env.local index 788b410..2311225 100644 --- a/.env.local +++ b/.env.local @@ -17,3 +17,4 @@ REACT_APP_ROLE_SUPPLIER_APPROVER=a6c9805e-80b2-42b2-bfbb-9df52e5504d8 REACT_APP_ROLE_MANIFEST_MIGRATION=42798c8a-9fa7-4fb4-82c0-9582cabe364f REACT_APP_ECCKEY_ENV=dev,stage,prod REACT_APP_HOME_MAP_DEFAULT_LOCATION={"lat":37.0902,"lng":-95.7129,"zoom":4.5} +REACT_APP_ENABLE_DEBUGMASK=1 \ No newline at end of file diff --git a/.env.prd b/.env.prd index f812b2a..878fe6b 100644 --- a/.env.prd +++ b/.env.prd @@ -17,3 +17,4 @@ REACT_APP_ROLE_SUPPLIER_APPROVER=a6c9805e-80b2-42b2-bfbb-9df52e5504d8 REACT_APP_ROLE_MANIFEST_MIGRATION=42798c8a-9fa7-4fb4-82c0-9582cabe364f REACT_APP_ECCKEY_ENV=stage REACT_APP_HOME_MAP_DEFAULT_LOCATION={"lat":37.0902,"lng":-95.7129,"zoom":4.5} +REACT_APP_ENABLE_DEBUGMASK=1 \ No newline at end of file diff --git a/.env.stg b/.env.stg index 702381f..df9db72 100644 --- a/.env.stg +++ b/.env.stg @@ -17,3 +17,4 @@ REACT_APP_ROLE_SUPPLIER_APPROVER=a6c9805e-80b2-42b2-bfbb-9df52e5504d8 REACT_APP_ROLE_MANIFEST_MIGRATION=42798c8a-9fa7-4fb4-82c0-9582cabe364f REACT_APP_ECCKEY_ENV=prod REACT_APP_HOME_MAP_DEFAULT_LOCATION={"lat":37.0902,"lng":-95.7129,"zoom":4.5} +REACT_APP_ENABLE_DEBUGMASK=1 \ No newline at end of file diff --git a/src/components/App/__snapshots__/App.test.js.snap b/src/components/App/__snapshots__/App.test.js.snap index ddb06f1..b23802c 100644 --- a/src/components/App/__snapshots__/App.test.js.snap +++ b/src/components/App/__snapshots__/App.test.js.snap @@ -467,7 +467,7 @@ exports[`App Route / authenticated 1`] = ` class="makeStyles-drawerHeader-0" />

@@ -8617,7 +8617,7 @@ exports[`App Route /tools/security-dll unauthenticated 1`] = ` class="makeStyles-drawerHeader-0" />

+
+
+ +
{ const [selectedEndDate, setSelectedEndDate] = useState(new Date()); const [selectedCanSignals, setSelectedCanSignals] = useState([]); const [selectAllCanSignals, setSelectAllCanSignals] = useState(false); + const [gmtTimezone, setGmtTimezone] = useState(false); const { token: { @@ -86,6 +87,12 @@ const MainForm = ({ id }) => { } }; + const displayTimeAsGMT = (date) => { + return gmtTimezone + ? date.toLocaleString("en-US", {timeZone: "Etc/GMT"}) + : date; + } + return (
@@ -102,7 +109,7 @@ const MainForm = ({ id }) => { margin="normal" id="date-picker-inline" label="Date From" - value={selectedStartDate} + value={displayTimeAsGMT(selectedStartDate)} onChange={(value) => handleDateChange(value, "start")} KeyboardButtonProps={{ 'aria-label': 'change date', @@ -116,7 +123,7 @@ const MainForm = ({ id }) => { variant="inline" id="time-picker" label="Time From" - value={selectedStartDate} + value={displayTimeAsGMT(selectedStartDate)} onChange={handleTimeFromChange} KeyboardButtonProps={{ 'aria-label': 'change time', @@ -132,7 +139,7 @@ const MainForm = ({ id }) => { margin="normal" id="date-picker-inline" label="Date To" - value={selectedEndDate} + value={displayTimeAsGMT(selectedEndDate)} onChange={(value) => handleDateChange(value, "end")} KeyboardButtonProps={{ 'aria-label': 'change date', @@ -146,13 +153,24 @@ const MainForm = ({ id }) => { id="time-picker" variant="inline" label="Time To" - value={selectedEndDate} + value={displayTimeAsGMT(selectedEndDate)} onChange={handleTimeToChange} KeyboardButtonProps={{ 'aria-label': 'change time', }} /> + + setGmtTimezone((current) => !current)} + /> + } + /> + diff --git a/src/components/Cars/Status/Details/__snapshots__/index.test.jsx.snap b/src/components/Cars/Status/Details/__snapshots__/index.test.jsx.snap index 21c8b1b..8925b8e 100644 --- a/src/components/Cars/Status/Details/__snapshots__/index.test.jsx.snap +++ b/src/components/Cars/Status/Details/__snapshots__/index.test.jsx.snap @@ -168,6 +168,43 @@ exports[`VehicleDetailsTab Render 1`] = ` /> + { const [redirect, setRedirect] = useState(null); const [showDeleteModal, setShowDeleteModal] = useState(false); const [showUploadConfigModal, setShowUploadConfigModal] = useState(false); + const [forced, setForced] = useState(false); const { token: { idToken: { jwtToken: token }, @@ -35,8 +36,11 @@ const MainForm = ({ vin }) => { providers, } = useUserContext(); - const ENV = process.env.REACT_APP_ENV; - const showDebugMask = (ENV === 'local' || ENV === 'dev' || ENV === 'stg' || ENV === 'prd' || ENV === 'cec-prd' || ENV === 'cec-euprd') + const showDebugMask = (process.env.REACT_APP_ENABLE_DEBUGMASK === "1"); + + const onForcedChange = (event) => { + setForced(event.target.checked); + } useEffect(() => { (async () => { @@ -64,7 +68,7 @@ const MainForm = ({ vin }) => { const onUploadConfig = async () => { try { - await uploadConfig(vin, token); + await uploadConfig(vin, forced, token); setMessage(`Config Uploaded ${vin}`); } catch (e) { setMessage(e.message); @@ -160,6 +164,15 @@ const MainForm = ({ vin }) => { providers={providers} rolesPerProvider={Permissions.FiskerCreate} > + + } + /> setShowUploadConfigModal(true)}> diff --git a/src/components/Cars/Status/__snapshots__/DetailsTab.test.jsx.snap b/src/components/Cars/Status/__snapshots__/DetailsTab.test.jsx.snap index 7b0a25e..46d8008 100644 --- a/src/components/Cars/Status/__snapshots__/DetailsTab.test.jsx.snap +++ b/src/components/Cars/Status/__snapshots__/DetailsTab.test.jsx.snap @@ -176,6 +176,43 @@ exports[`DetailsTab Render 1`] = ` /> + : - unknown + 12000 km

Max Range : - 577 + 577 km

: - 17 + 17 m

@@ -227,7 +227,7 @@ exports[`DigitalTwinTab Render 1`] = ` Vehicle Speed : - 77.7 + 77.7 km/h

diff --git a/src/components/Cars/Status/__snapshots__/index.test.jsx.snap b/src/components/Cars/Status/__snapshots__/index.test.jsx.snap index 87bc346..d28dffc 100644 --- a/src/components/Cars/Status/__snapshots__/index.test.jsx.snap +++ b/src/components/Cars/Status/__snapshots__/index.test.jsx.snap @@ -357,6 +357,43 @@ exports[`CarStatus Render 1`] = ` /> + { +
{ @@ -46,10 +46,10 @@ const MainForm = () => { const [dataLoggerEnabled, setDataLoggerEnabled] = useState(false); const [maxMemBufferSize, setMaxMemBufferSize] = useState(0); const [maxDiskBufferSize, setMaxDiskBufferSize] = useState(0); + const [dtcEnabled, setDTCEnabled] = useState(true); const debugMaskEl = useRef(null); - const ENV = process.env.REACT_APP_ENV; - const showDebugMask = (ENV === 'local' || ENV === 'dev' || ENV === 'stg' || ENV === 'prd' || ENV === 'cec-prd' || ENV === 'cec-euprd') + const showDebugMask = (process.env.REACT_APP_ENABLE_DEBUGMASK === "1"); useEffect(() => { setTitle("Update Vehicle"); @@ -96,6 +96,7 @@ const MainForm = () => { setDataLoggerEnabled(vehicle.canbus.data_logger_enabled ?? dataLoggerEnabled); setMaxMemBufferSize(vehicle.canbus.max_mem_buffer_size ?? maxMemBufferSize); setMaxDiskBufferSize(vehicle.canbus.max_disk_buffer_size ?? maxDiskBufferSize); + setDTCEnabled(vehicle.canbus.dtc_enabled ?? dtcEnabled); } if (showDebugMask) { @@ -117,6 +118,10 @@ const MainForm = () => { setDataLoggerEnabled(event.target.checked); } + const onDtcEnabledChange = (event) => { + setDTCEnabled(event.target.checked); + } + const onMaxMemBufferSizeChange = (event) => { setMaxMemBufferSize(event.target.value); } @@ -144,7 +149,8 @@ const MainForm = () => { enabled: canbusEnabled, data_logger_enabled: canbusEnabled ? dataLoggerEnabled : false, max_mem_buffer_size: canbusEnabled ? parseInt(maxMemBufferSize) : 0, - max_disk_buffer_size: canbusEnabled && dataLoggerEnabled ? parseInt(maxDiskBufferSize) : 0 + max_disk_buffer_size: canbusEnabled && dataLoggerEnabled ? parseInt(maxDiskBufferSize) : 0, + dtc_enabled: canbusEnabled ? dtcEnabled : false }, debug_mask: debugMaskEl.current?.value }; @@ -372,6 +378,13 @@ const MainForm = () => { disabled={!canbusEnabled} /> } label="Data Logger Enabled" /> + + } label="Data Logger Enabled" /> { } }; - const uploadConfig = async (vin, token) => { + const uploadConfig = async (vin, forced, token) => { try { setBusy(true); validateVIN(vin); - const result = await api.updateConfig(vin, token); + const result = await api.updateConfig(vin, forced, token); if (result.error) throw new Error(`Update vehicle error. ${result.message}`); return result; diff --git a/src/components/Contexts/__mocks__/VehicleContext.jsx b/src/components/Contexts/__mocks__/VehicleContext.jsx index 90844b5..1fca329 100644 --- a/src/components/Contexts/__mocks__/VehicleContext.jsx +++ b/src/components/Contexts/__mocks__/VehicleContext.jsx @@ -37,6 +37,7 @@ let vehicleState = { online: false, online_hmi: true, battery: { + total_mileage_odometer: 12000, percent: 95, }, max_range: { diff --git a/src/components/DTCTimeline/DTCTimeline/__snapshots__/index.test.jsx.snap b/src/components/DTCTimeline/DTCTimeline/__snapshots__/index.test.jsx.snap new file mode 100644 index 0000000..3cde435 --- /dev/null +++ b/src/components/DTCTimeline/DTCTimeline/__snapshots__/index.test.jsx.snap @@ -0,0 +1,716 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Render Render 1`] = ` +
+
+
+
+
+
+
+
+
+ +
+ +
+ +
+
+ +
+
+
+
+ +
+ +
+ +
+
+ +
+
+
+
+ +
+ +
+ +
+
+ +
+
+
+
+ +
+ +
+ +
+
+ +
+
+
+ +
+
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
+ + Id + + + + + VIN + + + + + ECU + + + + + Trouble Code + + + + + Status Code + + + + Error Text + + + Date + + sorted descending + + + +
+
+
+
+
+
+
+`; diff --git a/src/components/DTCTimeline/DTCTimeline/index.jsx b/src/components/DTCTimeline/DTCTimeline/index.jsx index c632d36..199bc83 100644 --- a/src/components/DTCTimeline/DTCTimeline/index.jsx +++ b/src/components/DTCTimeline/DTCTimeline/index.jsx @@ -1,13 +1,12 @@ import DateFnsUtils from '@date-io/date-fns'; -import { Button, CircularProgress, Grid, Table, TableBody, TableCell, TableFooter, TablePagination, TableRow } from "@material-ui/core"; -import { KeyboardDatePicker, MuiPickersUtilsProvider } from '@material-ui/pickers'; +import { Button, Checkbox, CircularProgress, FormControlLabel, Grid, Table, TableBody, TableCell, TableFooter, TablePagination, TableRow, TextField } from "@material-ui/core"; +import { KeyboardDatePicker, KeyboardTimePicker, MuiPickersUtilsProvider } from '@material-ui/pickers'; import clsx from "clsx"; import React, { useEffect, useState } from "react"; import { logger } from "../../../services/monitoring"; import { DTCTimelineProvider, useDTCTimelineContext } from '../../Contexts/DTCTimelineContext'; import { useStatusContext } from "../../Contexts/StatusContext"; import { useUserContext } from "../../Contexts/UserContext"; -import SearchField from '../../Controls/SearchField'; import TableHeaderSortable from "../../Table/HeaderSortable"; import { useLocalStorage } from "../../useLocalStorage"; import useStyles from "../../useStyles"; @@ -20,10 +19,11 @@ const MainForm = ({ vin }) => { const [pageIndex, setPageIndex] = useState(0); const [orderBy, setOrderBy] = useState("epoch_usec"); const [order, setOrder] = useState("desc"); - const { dtcData, getDTCData, total=0 } = useDTCTimelineContext(); + const { dtcData, getDTCData, total = 0 } = useDTCTimelineContext(); const [selectedStartDate, setSelectedStartDate] = useState(new Date(Date.now() - 24 * 60 * 60 * 1000)); const [selectedEndDate, setSelectedEndDate] = useState(new Date()); const [selectedECU, setSelectedECU] = useState(""); + const [gmtTimezone, setGmtTimezone] = useState(false); const [loading, setLoading] = useState(false); const { setMessage } = useStatusContext(); @@ -51,7 +51,7 @@ const MainForm = ({ vin }) => { { id: "ErrorText", label: "Error Text", - no_sort : true, + no_sort: true, }, { id: "epoch_usec", @@ -91,11 +91,9 @@ const MainForm = ({ vin }) => { setLoading(true); try { let start_date = new Date(selectedStartDate); - start_date.setHours(0, 0, 0, 0); start_date = start_date.toISOString(); let end_date = new Date(selectedEndDate); - end_date.setHours(23, 59, 59, 999); end_date = end_date.toISOString(); const search = { @@ -117,72 +115,149 @@ const MainForm = ({ vin }) => { return date.toLocaleString(); } - useEffect(() => { - fetchDTCData(); - // eslint-disable-next-line react-hooks/exhaustive-deps + const handleDateChange = (value, dateType) => { + const newDate = new Date(value); + const oldDate = dateType === "start" ? selectedStartDate || new Date() : selectedEndDate || new Date(); + newDate.setHours(oldDate.getHours()); + newDate.setMinutes(oldDate.getMinutes()); + newDate.setSeconds(oldDate.getSeconds()); + if (dateType === "start") { + setSelectedStartDate(newDate); + } else { + setSelectedEndDate(newDate); + } + }; + + const handleTimeFromChange = (value) => { + setSelectedStartDate(value); + }; + + const handleTimeToChange = (value) => { + setSelectedEndDate(value); + }; + + const displayTimeAsGMT = (date) => { + return gmtTimezone + ? date.toLocaleString("en-US", { timeZone: "Etc/GMT" }) + : date; + } + + useEffect(() => { + fetchDTCData(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [vin, selectedECU, selectedStartDate, selectedEndDate, pageIndex, pageSize, order, orderBy]); return (
- - + + + + + + handleDateChange(value, "start")} + KeyboardButtonProps={{ + 'aria-label': 'change date', + }} + /> + + + + + + handleDateChange(value, "end")} + KeyboardButtonProps={{ + 'aria-label': 'change date', + }} + /> + + + + + + setGmtTimezone((current) => !current)} + /> + } + /> + + + + +
- { - setSelectedECU(searchValue); + { + setSelectedECU(e.target.value); }} />
- - - - - - - - - - - + - -
+
{ ))} - + { onPageChange={handleChangePageIndex} onRowsPerPageChange={handleChangePageSize} /> - - + +
-
+
+
); diff --git a/src/components/DTCTimeline/DTCTimeline/index.test.jsx b/src/components/DTCTimeline/DTCTimeline/index.test.jsx new file mode 100644 index 0000000..58e29f1 --- /dev/null +++ b/src/components/DTCTimeline/DTCTimeline/index.test.jsx @@ -0,0 +1,42 @@ +jest.mock("../../Contexts/StatusContext"); +jest.mock("../../Contexts/UserContext"); +jest.mock("../../../services/CANSignalAPI"); +jest.useFakeTimers(); +jest.setSystemTime(new Date(2023, 3, 1, 6, 30, 45, 100)); + +import { render, waitFor } from "@testing-library/react"; +import { BrowserRouter } from "react-router-dom"; +import addSnapshotSerializer from "../../../utils/snapshot"; +import { TEST_AUTH_OBJECT_FISKER } from "../../../utils/testing"; + +import { StatusProvider } from "../../Contexts/StatusContext"; +import { setToken, UserProvider } from "../../Contexts/UserContext"; +import DTCTimeline from "./index"; + +const renderDTCTimeline = async () => { + const { container } = render( + + + + + + + + ); + await waitFor(() => { + /* render */ + }); + return container; +}; + +describe("Render", () => { + beforeAll(() => { + addSnapshotSerializer(expect); + }); + + it("Render", async () => { + setToken(TEST_AUTH_OBJECT_FISKER); + const container = await renderDTCTimeline(); + expect(container).toMatchSnapshot(); + }); +}); diff --git a/src/components/DigitalTwin/index.js b/src/components/DigitalTwin/index.js index 804e9e0..8548dc5 100644 --- a/src/components/DigitalTwin/index.js +++ b/src/components/DigitalTwin/index.js @@ -38,15 +38,15 @@ const DigitalTwin = (props) => {

Battery

{keyValueTemplate("Percentage", `${battery?.percent || 0}%`)} - {keyValueTemplate("Total Mileage", battery?.total_mileage_odometer || UNKNOWN)} - {keyValueTemplate("Max Range", max_range?.max_miles || UNKNOWN)} + {keyValueTemplate("Total Mileage", `${battery?.total_mileage_odometer} km` || UNKNOWN)} + {keyValueTemplate("Max Range", `${max_range?.max_miles} km` || UNKNOWN)}
)} {(vcu0x260 || charging_metrics) && (

Charging

{keyValueTemplate("Charge Type", vcu0x260?.charge_type || UNKNOWN)} - {keyValueTemplate("Remaining Time", charging_metrics?.remaining_charging_time || UNKNOWN)} + {keyValueTemplate("Remaining Time", `${charging_metrics?.remaining_charging_time} min` || UNKNOWN)}
)} {doors && ( @@ -95,7 +95,7 @@ const DigitalTwin = (props) => { return keyValueTemplate(value[0], "Invalid") } if (value[0] === "altitude") { - return keyValueTemplate(value[0], value[1]); + return keyValueTemplate(value[0], `${value[1]} m`); } else { return keyValueTemplate(value[0], `${value[1]}°`); } @@ -124,7 +124,7 @@ const DigitalTwin = (props) => { )} {vehicle_speed && (
- {keyValueTemplate("Vehicle Speed", vehicle_speed.speed)} + {keyValueTemplate("Vehicle Speed", `${vehicle_speed.speed} km/h`)}
)}
diff --git a/src/components/Layouts/MenuDrawer.jsx b/src/components/Layouts/MenuDrawer.jsx index f26a103..5e28a44 100644 --- a/src/components/Layouts/MenuDrawer.jsx +++ b/src/components/Layouts/MenuDrawer.jsx @@ -91,7 +91,7 @@ export default function MenuDrawer({ children }) { })} >
- {children} + {children}
); diff --git a/src/components/useStyles.jsx b/src/components/useStyles.jsx index edb09bc..5e7769e 100644 --- a/src/components/useStyles.jsx +++ b/src/components/useStyles.jsx @@ -127,6 +127,7 @@ const useStyles = makeStyles((theme) => ({ duration: theme.transitions.duration.enteringScreen, }), marginLeft: 0, + maxWidth: `calc(100% - ${DRAWER_WIDTH}px)`, }, rightToolbar: { marginLeft: "auto", @@ -161,7 +162,7 @@ const useStyles = makeStyles((theme) => ({ textAlign: "left", paddingLeft: theme.spacing(2), paddingRight: theme.spacing(1), - width: "100%", + maxWidth: "100%", }, logo: { height: 60, diff --git a/src/services/vehiclesAPI.js b/src/services/vehiclesAPI.js index a5e7d6e..4f9c359 100644 --- a/src/services/vehiclesAPI.js +++ b/src/services/vehiclesAPI.js @@ -173,8 +173,8 @@ const vehiclesAPI = { .then(fetchRespHandler) .catch(errorHandler), - updateConfig: async (vin, token) => - fetch(`${API_ENDPOINT}/car_config/${vin}`, { + updateConfig: async (vin, forced, token) => + fetch(`${API_ENDPOINT}/car_config/${vin}?forced=${forced}`, { method: "POST", headers: Object.assign( { "Content-Type": "application/json" },