fix: type check

This commit is contained in:
Daniel Hougaard
2025-01-16 01:08:43 +01:00
parent c4d0896609
commit 4e68304262
@@ -83,7 +83,6 @@ export const groupProjectServiceFactory = ({
const isUuid = isUuidV4(groupIdOrName); const isUuid = isUuidV4(groupIdOrName);
let group: TGroups | null = null; let group: TGroups | null = null;
// id can only be a uuid, name can be anything
if (isUuid) { if (isUuid) {
group = await groupDAL.findOne({ orgId: actorOrgId, id: groupIdOrName }); group = await groupDAL.findOne({ orgId: actorOrgId, id: groupIdOrName });
} }
@@ -139,7 +138,7 @@ export const groupProjectServiceFactory = ({
const projectGroup = await groupProjectDAL.transaction(async (tx) => { const projectGroup = await groupProjectDAL.transaction(async (tx) => {
const groupProjectMembership = await groupProjectDAL.create( const groupProjectMembership = await groupProjectDAL.create(
{ {
groupId: group.id, groupId: group!.id,
projectId: project.id projectId: project.id
}, },
tx tx
@@ -174,7 +173,7 @@ export const groupProjectServiceFactory = ({
// share project key with users in group that have not // share project key with users in group that have not
// individually been added to the project and that are not part of // individually been added to the project and that are not part of
// other groups that are in the project // other groups that are in the project
const groupMembers = await userGroupMembershipDAL.findGroupMembersNotInProject(group.id, project.id, tx); const groupMembers = await userGroupMembershipDAL.findGroupMembersNotInProject(group!.id, project.id, tx);
if (groupMembers.length) { if (groupMembers.length) {
const ghostUser = await projectDAL.findProjectGhostUser(project.id, tx); const ghostUser = await projectDAL.findProjectGhostUser(project.id, tx);