MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / syncConnection

Method syncConnection

packages/backend/src/api.ts:50–76  ·  view source on GitHub ↗
(req: Request, res: Response)

Source from the content-addressed store, hash-verified

48 }
49
50 private async syncConnection(req: Request, res: Response) {
51 const schema = z.object({
52 connectionId: z.number(),
53 }).strict();
54
55 const parsed = schema.safeParse(req.body);
56 if (!parsed.success) {
57 res.status(400).json({ error: parsed.error.message });
58 return;
59 }
60
61 const { connectionId } = parsed.data;
62 const connection = await this.prisma.connection.findUnique({
63 where: {
64 id: connectionId,
65 }
66 });
67
68 if (!connection) {
69 res.status(404).json({ error: 'Connection not found' });
70 return;
71 }
72
73 const [jobId] = await this.connectionManager.createJobs([connection]);
74
75 res.status(200).json({ jobId });
76 }
77
78 private async indexRepo(req: Request, res: Response) {
79 const schema = z.object({

Callers

nothing calls this directly

Calls 1

createJobsMethod · 0.45

Tested by

no test coverage detected