From 08d911afe32eff7a6adc5e466540c290249c179f Mon Sep 17 00:00:00 2001 From: jdude700 Date: Tue, 1 Oct 2024 18:23:12 +1000 Subject: [PATCH] add paused toggle to the edit custom reward node --- packages/packages/src/twitch/helix.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/packages/src/twitch/helix.ts b/packages/packages/src/twitch/helix.ts index 175526ef..2fb1c39a 100644 --- a/packages/packages/src/twitch/helix.ts +++ b/packages/packages/src/twitch/helix.ts @@ -1097,9 +1097,10 @@ export function register(pkg: Package, helix: Helix, types: Types) { async run({ ctx, io, account }) { if (ctx.getInput(io.id) === "") return; - const body: Record = { - title: ctx.getInput(io.title), - }; + const body: Record = {}; + ctx.getInput(io.title).peek((v) => { + body.title = v; + }); ctx.getInput(io.cost).peek((v) => { body.cost = v; }); @@ -1131,6 +1132,9 @@ export function register(pkg: Package, helix: Helix, types: Types) { ctx.getInput(io.skipRequestQueue).peek((v) => { body.should_redemptions_skip_request_queue = v; }); + ctx.getInput(io.paused).peek((v) => { + body.is_paused = v; + }); const data = await helix.call( "PATCH /channel_points/custom_rewards", @@ -1282,7 +1286,7 @@ export function register(pkg: Package, helix: Helix, types: Types) { }, ); - const data = rewards.find( + const data = rewards.data.find( (reward: any) => reward.title === ctx.getInput(io.title), );