Skip to content

Commit 606cd05

Browse files
committed
add configuration error
1 parent 7571e2b commit 606cd05

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

components/gorgias_oauth/actions/create-ticket-message/create-ticket-message.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,17 @@ export default {
162162
? this.toCustomer
163163
: this.toUser;
164164

165+
if (!fromId) {
166+
throw new ConfigurationError(`"${this.fromAgent
167+
? "From User"
168+
: "From Customer"}" is required when "From Agent" is set to \`${this.fromAgent}\``);
169+
}
170+
if (!toId) {
171+
throw new ConfigurationError(`"${this.fromAgent
172+
? "To Customer"
173+
: "To User"}" is required when "From Agent" is set to \`${this.fromAgent}\``);
174+
}
175+
165176
const response = await this.gorgiasOauth.createMessage({
166177
$,
167178
ticketId: this.ticketId,

0 commit comments

Comments
 (0)