This commit is contained in:
Carl-Gerhard Lindesvärd
2026-03-06 14:25:14 +01:00
parent 058c3621df
commit e6d0b6544b

View File

@@ -343,21 +343,29 @@ async function handleGroup(
const { id, type, name, properties = {} } = payload;
const profileId = payload.profileId ?? context.deviceId;
await Promise.all([
const promises: Promise<unknown>[] = [];
promises.push(
groupBuffer.add({
id,
projectId: context.projectId,
type,
name,
properties,
}),
upsertProfile({
id: profileId,
projectId: context.projectId,
isExternal: !!(payload.profileId ?? context.identity?.profileId),
groups: [id],
}),
]);
})
);
if (profileId) {
promises.push(
upsertProfile({
id: String(profileId),
projectId: context.projectId,
isExternal: !!(payload.profileId ?? context.identity?.profileId),
groups: [id],
})
);
}
await Promise.all(promises);
}
export async function handler(