fix guest actions

This commit is contained in:
Emily
2024-06-19 23:38:22 +02:00
parent c1a15c8fc2
commit 149592394d
9 changed files with 27 additions and 13 deletions

View File

@@ -8,8 +8,12 @@ export default defineEventHandler(async event => {
if (!user?.logged) return;
const project_id = getRequestProjectId(event);
if (!project_id) return;
const project = await ProjectModel.findOne({ _id: project_id, owner: user.id });
const project = await ProjectModel.findOne({ _id: project_id });
if (!project) return;
const [hasAccess] = await hasAccessToProject(user.id, project_id, project)
if (!hasAccess) return;
const query = getQuery(event);
const { orderBy, order, page, limit, type } = query;