MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / getGroupCore

Function getGroupCore

packages/db/src/services/group.service.ts:373–396  ·  view source on GitHub ↗
(input: {
  projectId: string;
  groupId: string;
  memberLimit?: number;
})

Source from the content-addressed store, hash-verified

371}
372
373export async function getGroupCore(input: {
374 projectId: string;
375 groupId: string;
376 memberLimit?: number;
377}) {
378 const [group, members] = await Promise.all([
379 getGroupById(input.groupId, input.projectId),
380 getGroupMemberProfiles({
381 projectId: input.projectId,
382 groupId: input.groupId,
383 take: input.memberLimit ?? 10,
384 }),
385 ]);
386
387 if (!group) {
388 throw new Error(`Group not found: ${input.groupId}`);
389 }
390
391 return {
392 group,
393 member_count: members.count,
394 members: members.data,
395 };
396}

Callers 2

getGroupFunction · 0.90
groups.tsFile · 0.90

Calls 2

getGroupByIdFunction · 0.85
getGroupMemberProfilesFunction · 0.85

Tested by

no test coverage detected