Skip to content

Commit 870e9c9

Browse files
committed
cleanup basket
1 parent 7033d46 commit 870e9c9

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

apps/basket/src/routes/basket.ts

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -230,35 +230,25 @@ async function processWebVitalsEventData(
230230
};
231231
}
232232

233-
async function processCustomEventData(
233+
function processCustomEventData(
234234
customData: any,
235235
clientId: string
236-
): Promise<CustomEvent> {
237-
const eventId = parseEventId(customData.eventId, randomUUID);
238-
const timestamp = parseTimestamp(customData.timestamp);
239-
236+
): CustomEvent {
240237
return {
241238
id: randomUUID(),
242239
client_id: clientId,
243-
event_name: sanitizeString(
244-
customData.name,
245-
VALIDATION_LIMITS.SHORT_STRING_MAX_LENGTH
246-
),
247-
anonymous_id: sanitizeString(
248-
customData.anonymousId,
249-
VALIDATION_LIMITS.SHORT_STRING_MAX_LENGTH
250-
),
240+
event_name: sanitizeString(customData.name, VALIDATION_LIMITS.SHORT_STRING_MAX_LENGTH),
241+
anonymous_id: sanitizeString(customData.anonymousId, VALIDATION_LIMITS.SHORT_STRING_MAX_LENGTH),
251242
session_id: validateSessionId(customData.sessionId),
252243
properties: parseProperties(customData.properties),
253-
timestamp,
244+
timestamp: parseTimestamp(customData.timestamp),
254245
};
255246
}
256247

257-
async function processOutgoingLinkData(
248+
function processOutgoingLinkData(
258249
linkData: any,
259250
clientId: string
260-
): Promise<CustomOutgoingLink> {
261-
const eventId = parseEventId(linkData.eventId, randomUUID);
251+
): CustomOutgoingLink {
262252
const timestamp = parseTimestamp(linkData.timestamp);
263253

264254
return {

0 commit comments

Comments
 (0)