fix(api): spread profile payload correctly
This commit is contained in:
@@ -4,7 +4,6 @@ import { parseUserAgent } from '@/utils/parseUserAgent';
|
|||||||
import type { FastifyReply, FastifyRequest } from 'fastify';
|
import type { FastifyReply, FastifyRequest } from 'fastify';
|
||||||
import { path, assocPath, pathOr, pick } from 'ramda';
|
import { path, assocPath, pathOr, pick } from 'ramda';
|
||||||
|
|
||||||
import { toISOString } from '@openpanel/common';
|
|
||||||
import { generateDeviceId } from '@openpanel/common/server';
|
import { generateDeviceId } from '@openpanel/common/server';
|
||||||
import {
|
import {
|
||||||
createProfileAlias,
|
createProfileAlias,
|
||||||
@@ -246,6 +245,7 @@ async function identify({
|
|||||||
}) {
|
}) {
|
||||||
const uaInfo = parseUserAgent(ua);
|
const uaInfo = parseUserAgent(ua);
|
||||||
await upsertProfile({
|
await upsertProfile({
|
||||||
|
...payload,
|
||||||
id: payload.profileId,
|
id: payload.profileId,
|
||||||
isExternal: true,
|
isExternal: true,
|
||||||
projectId,
|
projectId,
|
||||||
@@ -254,7 +254,6 @@ async function identify({
|
|||||||
...(geo ?? {}),
|
...(geo ?? {}),
|
||||||
...uaInfo,
|
...uaInfo,
|
||||||
},
|
},
|
||||||
...payload,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user