Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 59296f3

Browse files
committed
fix(server): crashes due to req.body being undefined
1 parent b3270ae commit 59296f3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

apps/server/src/routes/api/openai.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import OpenAI from "openai";
4848
*/
4949
async function listModels(req: Request, res: Response) {
5050
try {
51-
const { baseUrl } = req.body;
51+
const { baseUrl } = req.body ?? {};
5252

5353
// Use provided base URL or default from options
5454
const openaiBaseUrl = baseUrl || await options.getOption('openaiBaseUrl') || 'https://api.openai.com/v1';

apps/server/src/routes/api/script.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function getRelationBundles(req: Request) {
118118

119119
function getBundle(req: Request) {
120120
const note = becca.getNoteOrThrow(req.params.noteId);
121-
const { script, params } = req.body;
121+
const { script, params } = req.body ?? {};
122122

123123
return scriptService.getScriptBundleForFrontend(note, script, params);
124124
}

0 commit comments

Comments
 (0)