Skip to content

Commit 655b46d

Browse files
committed
updates
1 parent 2d0c404 commit 655b46d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

components/expensify/actions/export-report/export-report.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export default defineAction({
110110
templatePath: {
111111
type: "string",
112112
label: "Template Path",
113-
description: "The path in the /tmp directory to the template to use for the export",
113+
description: "The path in the /tmp directory to the template to use for the export. Required if `fileExtension` is `csv`, `txt`, `json`, or `xml`.",
114114
optional: true,
115115
},
116116
limit: {
@@ -136,6 +136,15 @@ export default defineAction({
136136
throw new ConfigurationError("At least one of `reportIds`, `startDate`, or `approvedAfter` must be specified");
137137
}
138138

139+
if ([
140+
"csv",
141+
"txt",
142+
"json",
143+
"xml",
144+
].includes(this.fileExtension) && !this.templatePath) {
145+
throw new ConfigurationError(`Template path is required for file extension: ${this.fileExtension}`);
146+
}
147+
139148
const onFinish = [];
140149
if (this.emailRecipients) {
141150
onFinish.push({

0 commit comments

Comments
 (0)