Skip to content

Commit

Permalink
verify payload type for set-speed
Browse files Browse the repository at this point in the history
  • Loading branch information
jwetzell committed Nov 13, 2024
1 parent 40c15f1 commit 3e7bdd3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/server/src/api-integration/integration.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ const actionHandlers: Record<string, ActionHandler> = {
return { payload: factor };
},
'set-speed': (payload) => {
// TODO: validate payload type
const factor = runtimeService.setSpeed(payload as number);
return { payload: factor };
const speedToSet = numberOrError(payload);
const speedSet = runtimeService.setSpeed(speedToSet);
return { payload: speedSet };
},
'reset-speed': () => {
const factor = runtimeService.resetSpeed();
Expand Down

0 comments on commit 3e7bdd3

Please sign in to comment.