Skip to content

Commit 3acf535

Browse files
authored
fix: wrong params for messaging triggers on containers (#311)
1 parent d4ecf54 commit 3acf535

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

deploy/lib/deployTriggers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ module.exports = {
7979
});
8080
}
8181
if ("nats" in event) {
82-
this.createMessageTrigger(application.id, {
82+
this.createMessageTrigger(application.id, isFunction, {
8383
name: event.nats.name,
8484
scw_nats_config: event.nats.scw_nats_config,
8585
});
8686
}
8787
if ("sqs" in event) {
88-
this.createMessageTrigger(application.id, {
88+
this.createMessageTrigger(application.id, isFunction, {
8989
name: event.sqs.name,
9090
scw_sqs_config: {
9191
queue: event.sqs.queue,

shared/api/triggers.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,18 @@ module.exports = {
4545
.catch(manageError);
4646
},
4747

48-
createMessageTrigger(applicationId, params) {
48+
createMessageTrigger(applicationId, isFunction, params) {
4949
let payload = {
5050
...params,
5151
function_id: applicationId,
5252
};
5353

54+
if (!isFunction) {
55+
payload = {
56+
...params,
57+
container_id: applicationId,
58+
};
59+
}
5460
return this.apiManager
5561
.post("triggers", payload)
5662
.then((response) => response.data)

0 commit comments

Comments
 (0)