wip
This commit is contained in:
@@ -63,6 +63,7 @@ async function main() {
|
||||
imported_at: null,
|
||||
sdk_name: 'test-script',
|
||||
sdk_version: '1.0.0',
|
||||
groups: [],
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -341,13 +341,23 @@ async function handleGroup(
|
||||
context: TrackContext
|
||||
): Promise<void> {
|
||||
const { id, type, name, properties = {} } = payload;
|
||||
await upsertGroup({
|
||||
id,
|
||||
projectId: context.projectId,
|
||||
type,
|
||||
name,
|
||||
properties,
|
||||
});
|
||||
const profileId = payload.profileId ?? context.deviceId;
|
||||
|
||||
await Promise.all([
|
||||
upsertGroup({
|
||||
id,
|
||||
projectId: context.projectId,
|
||||
type,
|
||||
name,
|
||||
properties,
|
||||
}),
|
||||
upsertProfile({
|
||||
id: profileId,
|
||||
projectId: context.projectId,
|
||||
isExternal: !!(payload.profileId ?? context.identity?.profileId),
|
||||
groups: [id],
|
||||
}),
|
||||
]);
|
||||
}
|
||||
|
||||
export async function handler(
|
||||
|
||||
Reference in New Issue
Block a user