mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
add dashboard
This commit is contained in:
9
dashboard/server/api/user/is_first_time.ts
Normal file
9
dashboard/server/api/user/is_first_time.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { ProjectModel } from "@schema/ProjectSchema";
|
||||
import { AuthContext } from "~/server/middleware/01-authorization";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
const userData: AuthContext = getRequestUser(event) as any;
|
||||
if (!userData.logged) return;
|
||||
const userProjects = await ProjectModel.countDocuments({ owner: userData.id });
|
||||
return userProjects == 0;
|
||||
});
|
||||
Reference in New Issue
Block a user