Add VIN to vehicle info.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useMemo, useState } from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import {
|
||||
FlatList,
|
||||
Image,
|
||||
@@ -7,16 +7,10 @@ import {
|
||||
TouchableOpacity,
|
||||
View,
|
||||
} from "react-native";
|
||||
import env from "../../env";
|
||||
import { DetermineFileType } from "../../util/document-upload.utility";
|
||||
import MediaCacheOverlay from "../media-cache-overlay/media-cache-overlay.component";
|
||||
import * as Sentry from "sentry-expo";
|
||||
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import axios from "axios";
|
||||
import cleanAxios from "../../util/CleanAxios";
|
||||
import normalizeUrl from "normalize-url";
|
||||
|
||||
export default function JobDocumentsLocalComponent({ bodyshop, job }) {
|
||||
const [previewVisible, setPreviewVisible] = useState(false);
|
||||
@@ -24,7 +18,6 @@ export default function JobDocumentsLocalComponent({ bodyshop, job }) {
|
||||
const [imgIndex, setImgIndex] = useState(0);
|
||||
useEffect(() => {
|
||||
if (job.id) {
|
||||
console.log("Getting Photos!");
|
||||
getPhotos({ bodyshop, jobid: job.id, setImages });
|
||||
}
|
||||
}, [job.id, bodyshop]);
|
||||
@@ -32,7 +25,7 @@ export default function JobDocumentsLocalComponent({ bodyshop, job }) {
|
||||
const onRefresh = async () => {
|
||||
return getPhotos({ bodyshop, jobid: job.id, setImages });
|
||||
};
|
||||
console.log(images);
|
||||
|
||||
return (
|
||||
<View style={{ flex: 1 }}>
|
||||
<FlatList
|
||||
@@ -78,7 +71,6 @@ export default function JobDocumentsLocalComponent({ bodyshop, job }) {
|
||||
}
|
||||
|
||||
async function getPhotos({ bodyshop, jobid, setImages }) {
|
||||
console.log("In Get Photos", bodyshop.localmediatoken);
|
||||
const localmediaserverhttp = bodyshop.localmediaserverhttp.trim();
|
||||
try {
|
||||
const imagesFetch = await cleanAxios.post(
|
||||
@@ -88,10 +80,6 @@ async function getPhotos({ bodyshop, jobid, setImages }) {
|
||||
},
|
||||
{ headers: { ims_token: bodyshop.localmediatoken } }
|
||||
);
|
||||
console.log(
|
||||
"🚀 ~ file: job-documents-local.component.jsx ~ line 86 ~ imagesFetch",
|
||||
imagesFetch
|
||||
);
|
||||
|
||||
const normalizedImages = imagesFetch.data
|
||||
.filter((d) => d.type?.mime?.startsWith("image"))
|
||||
@@ -110,6 +98,6 @@ async function getPhotos({ bodyshop, jobid, setImages }) {
|
||||
});
|
||||
setImages(normalizedImages);
|
||||
} catch (error) {
|
||||
console.log("error,", error);
|
||||
Sentry.Native.captureException(error);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user