summary refs log tree commit diff
path: root/src/api/util
diff options
context:
space:
mode:
authorMathMan05 <mathmanrm@gmail.com>2026-03-02 10:28:19 -0600
committerRory& <root@rory.gay>2026-03-20 16:31:32 +0100
commit5ff3226555eb241ec6c2660a22e6d58a0b57afa6 (patch)
tree31a7b9f6e23858a243eb697e045c9b1850b30dde /src/api/util
parentfix more (diff)
downloadserver-ts-5ff3226555eb241ec6c2660a22e6d58a0b57afa6.tar.xz
more pk fixes
Diffstat (limited to 'src/api/util')
-rw-r--r--src/api/util/handlers/Message.ts1
-rw-r--r--src/api/util/handlers/route.ts8
2 files changed, 5 insertions, 4 deletions
diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts

index be40f754..c6bad9c0 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts
@@ -773,6 +773,7 @@ export async function postHandleMessage(message: Message) { const linkMatches = content?.match(LINK_REGEX) || []; message.clean_data(); const data = { ...message.toJSON() }; + console.log(message); const currentNormalizedUrls = new Set<string>(); for (const link of linkMatches) { diff --git a/src/api/util/handlers/route.ts b/src/api/util/handlers/route.ts
index 17501524..0dd4a4b4 100644 --- a/src/api/util/handlers/route.ts +++ b/src/api/util/handlers/route.ts
@@ -52,7 +52,7 @@ export interface RouteOptions { body?: string; }; }; - stripNulls?: stripNulls; + stripNulls?: stripNulls | true; event?: EVENT | EVENT[]; summary?: string; description?: string; @@ -75,7 +75,6 @@ export interface RouteOptions { // }; } export function stripNull(obj: object) { - console.log(Object.entries(obj)); for (const [key, value] of Object.entries(obj)) { if (value instanceof Object || (value && !value.__proto__)) { stripNull(value); @@ -137,11 +136,12 @@ export function route(opts: RouteOptions) { if (validate && !ignoredRequestSchemas.includes(opts.requestBody!)) { if (opts.stripNulls) { - followNullPath(req.body, opts.stripNulls); + if (opts.stripNulls === true) stripNull(req.body); + else followNullPath(req.body, opts.stripNulls); } const valid = validate(req.body); if (!valid) { - console.log(JSON.stringify(req.body)); + //console.log(JSON.stringify(req.body)); const fields: Record<string, { code?: string; message: string }> = {}; validate.errors?.forEach( (x) =>