Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

refactor(cli): reuse parseIdParam in parsePositiveIntQuery (#2184)

Gabriel Stein6616fd1af4ad
diff --git a/src/helpers/cliBridge.js b/src/helpers/cliBridge.js
index 11a54d45e..b9f098f7e 100644
--- a/src/helpers/cliBridge.js
+++ b/src/helpers/cliBridge.js
@@ -87,8 +87,8 @@ function parseIdParam(value) {
function parsePositiveIntQuery(query, key, fallback) {
const raw = query.get(key);
if (raw === null || raw === "") return fallback;
- const num = Number(raw);
- if (!Number.isInteger(num) || num <= 0) {
+ const num = parseIdParam(raw);
+ if (num === null) {
const err = new Error(`Query parameter '${key}' must be a positive integer`);
err.code = "VALIDATION";
throw err;