mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
implementing domain selector
This commit is contained in:
18
dashboard/server/api/domains/list.ts
Normal file
18
dashboard/server/api/domains/list.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
import { VisitModel } from "@schema/metrics/VisitSchema";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
const data = await getRequestData(event, ['GUEST', 'LIVEMODE']);
|
||||
if (!data) return;
|
||||
|
||||
const { project_id } = data;
|
||||
|
||||
const result = await VisitModel.aggregate([
|
||||
{ $match: { project_id, } },
|
||||
{ $group: { _id: "$website" } },
|
||||
]);
|
||||
|
||||
return result as { _id: string }[];
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user