Skip to content

Commit

Permalink
Merge pull request #524 from Brendonovich/woops2
Browse files Browse the repository at this point in the history
add paused toggle to the edit custom reward node
  • Loading branch information
jdudetv authored Oct 1, 2024
2 parents 5086415 + 08d911a commit 9631234
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/packages/src/twitch/helix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any> = {
title: ctx.getInput(io.title),
};
const body: Record<string, any> = {};
ctx.getInput(io.title).peek((v) => {
body.title = v;
});
ctx.getInput(io.cost).peek((v) => {
body.cost = v;
});
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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),
);

Expand Down

0 comments on commit 9631234

Please sign in to comment.