mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-13 08:48:38 +01:00
new selfhosted version
This commit is contained in:
27
dashboard/server/api/admin/onboarding.ts
Normal file
27
dashboard/server/api/admin/onboarding.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
import { OnboardingModel } from "~/shared/schema/OnboardingSchema";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
const ctx = await getRequestContext(event, 'admin');
|
||||
|
||||
const analytics = await OnboardingModel.aggregate([
|
||||
{
|
||||
$group: {
|
||||
_id: '$analytics',
|
||||
count: { $sum: 1 }
|
||||
}
|
||||
},
|
||||
]);
|
||||
|
||||
const jobs = await OnboardingModel.aggregate([
|
||||
{
|
||||
$group: {
|
||||
_id: '$job',
|
||||
count: { $sum: 1 }
|
||||
}
|
||||
},
|
||||
])
|
||||
|
||||
return { analytics, jobs };
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user