mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-11 16:28:37 +01:00
new selfhosted version
This commit is contained in:
16
dashboard/server/api/admin/domains.ts
Normal file
16
dashboard/server/api/admin/domains.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Types } from "mongoose";
|
||||
import { VisitModel } from "~/shared/schema/metrics/VisitSchema";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
const ctx = await getRequestContext(event, 'admin');
|
||||
|
||||
const { pid } = getQuery(event);
|
||||
|
||||
const start = performance.now();
|
||||
const domains = await VisitModel.distinct('website', { project_id: new Types.ObjectId(pid as string) });
|
||||
const end = performance.now();
|
||||
|
||||
return domains;
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user