mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
feat: API for event data now can return associated event name
This commit is contained in:
parent
7bfbe26485
commit
92fc4e87c7
3 changed files with 68 additions and 9 deletions
|
|
@ -21,13 +21,19 @@ export default async (
|
|||
await useAuth(req, res);
|
||||
|
||||
if (req.method === 'GET') {
|
||||
const { websiteId, startAt, endAt, field } = req.query;
|
||||
const { websiteId, startAt, endAt, field, withEventNames } = req.query;
|
||||
|
||||
if (!(await canViewWebsite(req.auth, websiteId))) {
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
const data = await getEventDataFields(websiteId, new Date(+startAt), new Date(+endAt), field);
|
||||
const data = await getEventDataFields(
|
||||
websiteId,
|
||||
new Date(+startAt),
|
||||
new Date(+endAt),
|
||||
field,
|
||||
withEventNames,
|
||||
);
|
||||
|
||||
return ok(res, data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue