From 4ebe06e6fa09280af60a72faca8eea807043f397 Mon Sep 17 00:00:00 2001 From: Robin Leber <rleber98@gmail.com> Date: Wed, 26 Jun 2024 18:22:45 +0200 Subject: [PATCH] FIX: correct topic creation --- src/functions/pipeBinding.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/functions/pipeBinding.js b/src/functions/pipeBinding.js index 6c32e2c..8df6fcb 100644 --- a/src/functions/pipeBinding.js +++ b/src/functions/pipeBinding.js @@ -63,7 +63,11 @@ export const handlePipeBinding = (pipeMapping, editor) => { let position = line.from; let pipeNameUserGiven = pipe.pipeName; let pipeNameDeklaration = makeValidConstName(pipeNameUserGiven); - let insertCode = `\t\tconst ${pipeNameDeklaration} = "${pipeNameUserGiven}";\n\t\tawait channel.assert${pipe.pipeType}(${pipeNameDeklaration}, {\n\t\t\tdurable: false\n\t\t});\n`; + let insertCode = `\t\tconst ${pipeNameDeklaration} = "${pipeNameUserGiven}";\n\t\tchannel.assert${ + pipe.pipeType === "Queue" ? "Queue" : "Exchange" + }(${pipeNameDeklaration}, ${ + pipe.pipeType === "Topic" ? `"topic", ` : "" + }{\n\t\t\tdurable: false\n\t\t});\n`; let transaction = editor.state.update({ changes: { from: position, -- GitLab