fixes/attachments loging

This commit is contained in:
Shams mosowi
2020-09-21 22:28:41 +10:00
parent 31eed47872
commit e22bf25588
4 changed files with 8 additions and 7 deletions

View File

@@ -41,8 +41,7 @@ const emailOnCreate = (config: EmailOnTriggerConfig) =>
const to = await config.to(snapshotData, db);
const attachments = config.attachments
? await config.attachments(snapshotData, db)
: null;
console.log({ attachments: snapshotData.attachments });
: undefined;
if (shouldSend && hasAllRequiredFields) {
const msg = {
from,
@@ -58,9 +57,9 @@ const emailOnCreate = (config: EmailOnTriggerConfig) =>
categories: config.categories,
attachments,
};
console.log({ msg });
const resp = await sendEmail(msg);
console.log({ resp });
return resp;
} else {
console.log("requirements were not met");

View File

@@ -73,7 +73,7 @@ const Hotkeys = (props: any) => {
if (stringFields.includes(column.type))
onSubmit(column.key, row, currentUser?.uid)(newValue);
else if (numberFields.includes(column.type)) {
const numberValue = parseInt(newValue);
const numberValue = parseInt(newValue, 10);
if (`${numberValue}` !== "NaN") {
onSubmit(column.key, row, currentUser?.uid)(numberValue);
}

View File

@@ -79,7 +79,10 @@ export default function Action({
(response) => {
const { message, cellValue, success } = response.data;
setIsRunning(false);
snack.open({ message, severity: success ? "success" : "error" });
snack.open({
message: JSON.stringify(message),
severity: success ? "success" : "error",
});
if (cellValue) onSubmit(cellValue);
},
(error) => {

View File

@@ -112,7 +112,6 @@ export const getFormatter = (column: any, readOnly: boolean = false) => {
case FieldType.shortText:
case FieldType.email:
case FieldType.phone:
case FieldType.url:
case FieldType.number:
case FieldType.slider:
return undefined;