new selfhosted version

This commit is contained in:
antonio
2025-11-28 14:11:51 +01:00
parent afda29997d
commit 951860f67e
1046 changed files with 72586 additions and 574750 deletions

View File

@@ -2,11 +2,10 @@ import { ProjectModel, TProject } from "@schema/project/ProjectSchema";
export default defineEventHandler(async event => {
const userData = getRequestUser(event);
if (!userData?.logged) return [];
const userProjects = await ProjectModel.find({ owner: userData.id });
return userProjects.map(e => e.toJSON()) as TProject[];
const ctx = await getRequestContext(event);
const { user_id } = ctx;
const projects = await ProjectModel.find({ owner: user_id });
return projects.map(e => e.toJSON()) as TProject[];
});