refactor: update pull request handler to use new parameter style

This commit is contained in:
Peter M. Elias
2024-12-28 03:16:19 -08:00
parent 42872be9a2
commit b8b7c1b784

View File

@@ -8,7 +8,6 @@ import {
import { z } from 'zod';
import { zodToJsonSchema } from 'zod-to-json-schema';
// Import operations
import * as repository from './operations/repository.js';
import * as files from './operations/files.js';
import * as issues from './operations/issues.js';
@@ -223,8 +222,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
case "create_pull_request": {
const args = pulls.CreatePullRequestSchema.parse(request.params.arguments);
const { owner, repo, ...options } = args;
const pullRequest = await pulls.createPullRequest(owner, repo, options);
const pullRequest = await pulls.createPullRequest(args);
return {
content: [{ type: "text", text: JSON.stringify(pullRequest, null, 2) }],
};
@@ -314,5 +312,4 @@ async function runServer() {
runServer().catch((error) => {
console.error("Fatal error in main():", error);
process.exit(1);
});
process.exit(1);