diff --git a/src/index.ts b/src/index.ts index ea4cb4c..73b59e6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1074,8 +1074,8 @@ server.tool( title, content_base64: Buffer.from(content).toString('base64'), }; - if (message) body.message = message; - return formatResponse(await clientFor(connection).post(`/repos/${owner}/${repo}/wiki/new`, body)); + if (message !== undefined) body.message = message; + return formatResponse(await clientFor(connection).post(`/repos/${owner}/${repo}/wiki/pages`, body)); }, ); @@ -1094,8 +1094,8 @@ server.tool( const body: Record = { content_base64: Buffer.from(content).toString('base64'), }; - if (title) body.title = title; - if (message) body.message = message; + if (title !== undefined) body.title = title; + if (message !== undefined) body.message = message; return formatResponse(await clientFor(connection).patch(`/repos/${owner}/${repo}/wiki/page/${page_name}`, body)); }, );