MCPcopy Create free account
hub / github.com/Kong/insomnia / syncProjects

Function syncProjects

packages/insomnia-data/node-src/services/project.ts:187–198  ·  view source on GitHub ↗
(organizationId: string)

Source from the content-addressed store, hash-verified

185}
186
187export async function syncProjects(organizationId: string) {
188 // Local-only organizations have no team projects to fetch, so bail out before the request.
189 if (models.organization.isLocalOrganizationId(organizationId)) {
190 return;
191 }
192 const user = await userSessionService.get();
193 const teamProjects = await getAllTeamProjects(organizationId);
194 // ensure we don't sync projects in the wrong place
195 if (Array.isArray(teamProjects) && user.id) {
196 await syncTeamProjects({ teamProjects, organizationId });
197 }
198}

Callers 3

clientActionFunction · 0.90
clientLoaderFunction · 0.90
clientActionFunction · 0.90

Calls 3

getAllTeamProjectsFunction · 0.85
syncTeamProjectsFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected