Skip to content

Commit 4b38191

Browse files
committed
Checking for undefined values on formData
1 parent 10ae11b commit 4b38191

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

components/frontapp/actions/create-message-template/create-message-template.mjs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,15 @@ export default {
6969

7070
formData.append("name", name);
7171
formData.append("body", body);
72-
formData.append("subject", subject);
73-
formData.append("folder_id", folderId);
74-
formData.append("inbox_ids", inboxIds);
72+
if (subject !== undefined) {
73+
formData.append("subject", subject);
74+
}
75+
if (folderId !== undefined) {
76+
formData.append("folder_id", folderId);
77+
}
78+
if (inboxIds !== undefined) {
79+
formData.append("inbox_ids", inboxIds);
80+
}
7581

7682
for (const attachment of attachments) {
7783
const {

0 commit comments

Comments
 (0)