feature/IO-3103-Ant5-Notifications
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { notification } from "antd";
|
||||
import axios from "axios";
|
||||
import i18n from "i18next";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
@@ -14,7 +13,7 @@ import { store } from "../../redux/store";
|
||||
var cleanAxios = axios.create();
|
||||
cleanAxios.interceptors.request.eject(axiosAuthInterceptorId);
|
||||
|
||||
export const handleUpload = (ev, context) => {
|
||||
export const handleUpload = (ev, context, notification) => {
|
||||
logImEXEvent("document_upload", { filetype: ev.file.type });
|
||||
|
||||
const { onError, onSuccess, onProgress } = ev;
|
||||
@@ -24,10 +23,20 @@ export const handleUpload = (ev, context) => {
|
||||
|
||||
let key = `${bodyshop.id}/${jobId}/${replaceAccents(fileName).replace(/[^A-Z0-9]+/gi, "_")}-${new Date().getTime()}`;
|
||||
let extension = fileName.split(".").pop();
|
||||
uploadToCloudinary(key, extension, ev.file.type, ev.file, onError, onSuccess, onProgress, context);
|
||||
uploadToCloudinary(key, extension, ev.file.type, ev.file, onError, onSuccess, onProgress, context, notification);
|
||||
};
|
||||
|
||||
export const uploadToCloudinary = async (key, extension, fileType, file, onError, onSuccess, onProgress, context) => {
|
||||
export const uploadToCloudinary = async (
|
||||
key,
|
||||
extension,
|
||||
fileType,
|
||||
file,
|
||||
onError,
|
||||
onSuccess,
|
||||
onProgress,
|
||||
context,
|
||||
notification
|
||||
) => {
|
||||
const { bodyshop, jobId, billId, uploaded_by, callback, tagsArray } = context;
|
||||
|
||||
//Set variables for getting the signed URL.
|
||||
|
||||
Reference in New Issue
Block a user