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

Function syncConnection

packages/web/src/features/workerApi/actions.ts:12–36  ·  view source on GitHub ↗
(connectionId: number)

Source from the content-addressed store, hash-verified

10const WORKER_API_URL = 'http://localhost:3060';
11
12export const syncConnection = async (connectionId: number) => sew(() =>
13 withAuth(({ role }) =>
14 withMinimumOrgRole(role, OrgRole.OWNER, async () => {
15 const response = await fetch(`${WORKER_API_URL}/api/sync-connection`, {
16 method: 'POST',
17 body: JSON.stringify({
18 connectionId
19 }),
20 headers: {
21 'Content-Type': 'application/json',
22 },
23 });
24
25 if (!response.ok) {
26 return unexpectedError('Failed to sync connection');
27 }
28
29 const data = await response.json();
30 const schema = z.object({
31 jobId: z.string(),
32 });
33 return schema.parse(data);
34 })
35 )
36);
37
38export const indexRepo = async (repoId: number) => sew(() =>
39 withAuth(({ role }) =>

Callers 1

ConnectionJobsTableFunction · 0.90

Calls 4

sewFunction · 0.90
withAuthFunction · 0.90
withMinimumOrgRoleFunction · 0.90
unexpectedErrorFunction · 0.90

Tested by

no test coverage detected