fix
This commit is contained in:
@@ -343,21 +343,29 @@ async function handleGroup(
|
|||||||
const { id, type, name, properties = {} } = payload;
|
const { id, type, name, properties = {} } = payload;
|
||||||
const profileId = payload.profileId ?? context.deviceId;
|
const profileId = payload.profileId ?? context.deviceId;
|
||||||
|
|
||||||
await Promise.all([
|
const promises: Promise<unknown>[] = [];
|
||||||
|
promises.push(
|
||||||
groupBuffer.add({
|
groupBuffer.add({
|
||||||
id,
|
id,
|
||||||
projectId: context.projectId,
|
projectId: context.projectId,
|
||||||
type,
|
type,
|
||||||
name,
|
name,
|
||||||
properties,
|
properties,
|
||||||
}),
|
})
|
||||||
upsertProfile({
|
);
|
||||||
id: profileId,
|
|
||||||
projectId: context.projectId,
|
if (profileId) {
|
||||||
isExternal: !!(payload.profileId ?? context.identity?.profileId),
|
promises.push(
|
||||||
groups: [id],
|
upsertProfile({
|
||||||
}),
|
id: String(profileId),
|
||||||
]);
|
projectId: context.projectId,
|
||||||
|
isExternal: !!(payload.profileId ?? context.identity?.profileId),
|
||||||
|
groups: [id],
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
await Promise.all(promises);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function handler(
|
export async function handler(
|
||||||
|
|||||||
Reference in New Issue
Block a user