Add upload logging.
This commit is contained in:
@@ -6,6 +6,7 @@ import { INSERT_NEW_DOCUMENT } from "../../graphql/documents.queries";
|
||||
import { axiosAuthInterceptorId } from "../../utils/CleanAxios";
|
||||
import client from "../../utils/GraphQLClient";
|
||||
import exifr from "exifr";
|
||||
import { store } from "../../redux/store";
|
||||
|
||||
//Context: currentUserEmail, bodyshop, jobid, invoiceid
|
||||
|
||||
@@ -112,7 +113,19 @@ export const uploadToCloudinary = async (
|
||||
);
|
||||
|
||||
if (cloudinaryUploadResponse.status !== 200) {
|
||||
if (!!onError) onError(cloudinaryUploadResponse.statusText);
|
||||
if (!!onError) {
|
||||
onError(cloudinaryUploadResponse.statusText);
|
||||
}
|
||||
|
||||
try {
|
||||
axios.post("/newlog", {
|
||||
message: "client-cloudinary-upload-error",
|
||||
type: "error",
|
||||
user: store.getState().user.email,
|
||||
object: cloudinaryUploadResponse,
|
||||
});
|
||||
} catch (error) {}
|
||||
|
||||
notification["error"]({
|
||||
message: i18n.t("documents.errors.insert", {
|
||||
message: cloudinaryUploadResponse.statusText,
|
||||
|
||||
Reference in New Issue
Block a user