Lint all the things
This commit is contained in:
@@ -57,7 +57,7 @@ export const uploadToCloudinary = async (
|
||||
});
|
||||
|
||||
if (signedURLResponse.status !== 200) {
|
||||
if (!!onError) onError(signedURLResponse.statusText);
|
||||
if (onError) onError(signedURLResponse.statusText);
|
||||
notification["error"]({
|
||||
message: i18n.t("documents.errors.getpresignurl", {
|
||||
message: signedURLResponse.statusText
|
||||
@@ -71,7 +71,7 @@ export const uploadToCloudinary = async (
|
||||
var options = {
|
||||
headers: { "X-Requested-With": "XMLHttpRequest" },
|
||||
onUploadProgress: (e) => {
|
||||
if (!!onProgress) onProgress({ percent: (e.loaded / e.total) * 100 });
|
||||
if (onProgress) onProgress({ percent: (e.loaded / e.total) * 100 });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -95,7 +95,7 @@ export const uploadToCloudinary = async (
|
||||
);
|
||||
|
||||
if (cloudinaryUploadResponse.status !== 200) {
|
||||
if (!!onError) {
|
||||
if (onError) {
|
||||
onError(cloudinaryUploadResponse.statusText);
|
||||
}
|
||||
|
||||
@@ -106,7 +106,9 @@ export const uploadToCloudinary = async (
|
||||
user: store.getState().user.email,
|
||||
object: cloudinaryUploadResponse
|
||||
});
|
||||
} catch (error) {}
|
||||
} catch {
|
||||
// NO OP
|
||||
}
|
||||
|
||||
notification["error"]({
|
||||
message: i18n.t("documents.errors.insert", {
|
||||
@@ -123,7 +125,7 @@ export const uploadToCloudinary = async (
|
||||
const exif = await exifr.parse(file);
|
||||
|
||||
takenat = exif && exif.DateTimeOriginal;
|
||||
} catch (error) {
|
||||
} catch {
|
||||
console.log("Unable to parse image file for EXIF Data");
|
||||
}
|
||||
}
|
||||
@@ -146,7 +148,7 @@ export const uploadToCloudinary = async (
|
||||
}
|
||||
});
|
||||
if (!documentInsert.errors) {
|
||||
if (!!onSuccess)
|
||||
if (onSuccess)
|
||||
onSuccess({
|
||||
uid: documentInsert.data.insert_documents.returning[0].id,
|
||||
name: documentInsert.data.insert_documents.returning[0].name,
|
||||
@@ -162,7 +164,7 @@ export const uploadToCloudinary = async (
|
||||
callback();
|
||||
}
|
||||
} else {
|
||||
if (!!onError) onError(JSON.stringify(documentInsert.errors));
|
||||
if (onError) onError(JSON.stringify(documentInsert.errors));
|
||||
notification["error"]({
|
||||
message: i18n.t("documents.errors.insert", {
|
||||
message: JSON.stringify(documentInsert.errors)
|
||||
|
||||
Reference in New Issue
Block a user