Skip to content
7 changes: 2 additions & 5 deletions apps/api/src/controllers/event.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ export async function postEvent(
}>,
reply: FastifyReply
) {
const { timestamp, isTimestampFromThePast } = getTimestamp(
request.timestamp,
request.body
);
const { timestamp } = getTimestamp(request.timestamp, request.body);
const ip = request.clientIp;
const ua = request.headers['user-agent'] ?? 'unknown/1.0';
const projectId = request.client?.projectId;
Expand All @@ -34,6 +31,7 @@ export async function postEvent(
ip,
ua,
salts,
eventMs: new Date(timestamp).getTime(),
});

const uaInfo = parseUserAgent(ua, request.body?.properties);
Expand All @@ -48,7 +46,6 @@ export async function postEvent(
event: {
...request.body,
timestamp,
isTimestampFromThePast,
},
uaInfo,
geo,
Expand Down
Loading