mirror of
https://github.com/umami-software/umami.git
synced 2026-02-20 20:45:39 +01:00
Add event_data base.
This commit is contained in:
parent
72af76a417
commit
15c5cc065e
19 changed files with 395 additions and 45 deletions
|
|
@ -34,9 +34,14 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
|
|||
|
||||
const { type, payload } = getJsonBody(req);
|
||||
|
||||
const { referrer, eventName, pageTitle } = payload;
|
||||
const { referrer, eventName, eventData, pageTitle } = payload;
|
||||
let { url } = payload;
|
||||
|
||||
// Validate eventData is JSON
|
||||
if (eventData && !(typeof eventData === 'object' && !Array.isArray(eventData))) {
|
||||
return badRequest(res, 'Event Data must be in the form of a JSON Object.');
|
||||
}
|
||||
|
||||
const ignoreIps = process.env.IGNORE_IP;
|
||||
const ignoreHostnames = process.env.IGNORE_HOSTNAME;
|
||||
|
||||
|
|
@ -96,6 +101,7 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
|
|||
referrer,
|
||||
pageTitle,
|
||||
eventName,
|
||||
eventData,
|
||||
});
|
||||
} else {
|
||||
return badRequest(res);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue