Basic routing implementation.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import * as Sentry from "@sentry/react-native";
|
||||
|
||||
import axios from "axios";
|
||||
import * as MediaLibrary from "expo-media-library";
|
||||
import env from "../env";
|
||||
@@ -6,12 +6,11 @@ import { client } from "../graphql/client";
|
||||
import { INSERT_NEW_DOCUMENT } from "../graphql/documents.queries";
|
||||
import { axiosAuthInterceptorId } from "./CleanAxios";
|
||||
//import { splitClient } from "../components/screen-main/screen-main.component";
|
||||
import { File } from "expo-file-system";
|
||||
|
||||
//Context: currentUserEmail, bodyshop, jobid, invoiceid
|
||||
|
||||
//Required to prevent headers from getting set and rejected from Cloudinary.
|
||||
var cleanAxios = axios.create();
|
||||
let cleanAxios = axios.create();
|
||||
cleanAxios.interceptors.request.eject(axiosAuthInterceptorId);
|
||||
|
||||
export const handleUpload = async (ev, context) => {
|
||||
@@ -49,7 +48,7 @@ export const handleUpload = async (ev, context) => {
|
||||
} catch (error) {
|
||||
console.log("Error creating upload promise", error.message, error.stack);
|
||||
if (onError) onError(error.message);
|
||||
Sentry.captureException(error);
|
||||
|
||||
return {
|
||||
success: false,
|
||||
error: error.message,
|
||||
@@ -91,7 +90,7 @@ export const uploadToImgproxy = async (
|
||||
const { presignedUrl: preSignedUploadUrlToS3, key: s3Key } =
|
||||
signedURLResponse.data.signedUrls[0];
|
||||
|
||||
var options = {
|
||||
let options = {
|
||||
headers: {
|
||||
"Content-Type": fileType,
|
||||
"Content-Length": file.size,
|
||||
@@ -133,7 +132,7 @@ export const uploadToImgproxy = async (
|
||||
} catch (error) {
|
||||
console.log("Error uploading to S3", error.message, error.stack);
|
||||
if (onError) onError(error.message);
|
||||
Sentry.captureException(error);
|
||||
|
||||
return {
|
||||
success: false,
|
||||
error: error.message,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import axios from "axios";
|
||||
import { store } from "../redux/store";
|
||||
import mime from "mime";
|
||||
import * as MediaLibrary from "expo-media-library";
|
||||
import * as Sentry from "@sentry/react-native";
|
||||
import mime from "mime";
|
||||
import { store } from "../redux/store";
|
||||
|
||||
|
||||
axios.interceptors.request.use(
|
||||
function (config) {
|
||||
@@ -96,14 +96,12 @@ export const handleLocalUpload = async ({
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
Sentry.captureException(error);
|
||||
|
||||
console.log("Error uploading documents:", error.message);
|
||||
onError && onError({ error: error.message });
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("Uncaught error", error);
|
||||
Sentry.captureException(error);
|
||||
|
||||
onError && onError({ error: error.message });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user