( payload: IAssignGroupPayload, context: TrackContext )
| 370 | } |
| 371 | |
| 372 | async function handleAssignGroup( |
| 373 | payload: IAssignGroupPayload, |
| 374 | context: TrackContext |
| 375 | ): Promise<void> { |
| 376 | const profileId = payload.profileId ?? context.deviceId; |
| 377 | if (!profileId) { |
| 378 | return; |
| 379 | } |
| 380 | await upsertProfile({ |
| 381 | id: String(profileId), |
| 382 | projectId: context.projectId, |
| 383 | isExternal: !!payload.profileId, |
| 384 | groups: payload.groupIds, |
| 385 | }); |
| 386 | } |
| 387 | |
| 388 | export async function handler( |
| 389 | request: FastifyRequest<{ |
no test coverage detected