mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 15:58:38 +01:00
11 lines
333 B
TypeScript
11 lines
333 B
TypeScript
import { ProjectModel, TProject } from "@schema/project/ProjectSchema";
|
|
|
|
export default defineEventHandler(async event => {
|
|
|
|
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[];
|
|
|
|
}); |