Truncate strings.

This commit is contained in:
Mike Cao 2021-03-26 20:56:08 -07:00
parent 9415fe9a6c
commit b24b855006

View File

@ -184,8 +184,8 @@ export async function savePageView(website_id, session_id, url, referrer) {
data: {
website_id,
session_id,
url: url.substr(0, URL_LENGTH),
referrer: referrer.substr(0, URL_LENGTH),
url: url?.substr(0, URL_LENGTH),
referrer: referrer?.substr(0, URL_LENGTH),
},
}),
);
@ -197,9 +197,9 @@ export async function saveEvent(website_id, session_id, url, event_type, event_v
data: {
website_id,
session_id,
url: url.substr(0, URL_LENGTH),
event_type,
event_value,
url: url?.substr(0, URL_LENGTH),
event_type: event_type?.substr(0, 50),
event_value: event_value?.substr(0, 50),
},
}),
);