fix: minor things before merging new order keys

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-12-02 19:03:34 +01:00
parent 7c387bb6ae
commit 25e3a84bf6
7 changed files with 42 additions and 48 deletions

View File

@@ -1,6 +1,7 @@
import type { FastifyReply, FastifyRequest } from 'fastify';
import { assocPath, pathOr, pick } from 'ramda';
import { HttpError } from '@/utils/errors';
import { generateId, slug } from '@openpanel/common';
import { generateDeviceId, parseUserAgent } from '@openpanel/common/server';
import { getProfileById, getSalts, upsertProfile } from '@openpanel/db';
@@ -187,9 +188,16 @@ export async function handler(
break;
}
case 'identify': {
const payload = request.body.payload;
const geo = await getGeoLocation(ip);
if (!payload.profileId) {
throw new HttpError('Missing profileId', {
status: 400,
});
}
await identify({
payload: request.body.payload,
payload,
projectId,
geo,
ua,