Skip to content

Scheduling infrastructure for absolutely everyone.

fix: improve comments on teams

Agusti Fernandez Pardo674984007754
diff --git a/pages/api/teams/index.ts b/pages/api/teams/index.ts
index 3fcd7d7d05c..a480bff97a1 100644
--- a/pages/api/teams/index.ts
+++ b/pages/api/teams/index.ts
@@ -56,16 +56,15 @@ async function createOrlistAllTeams(req: NextApiRequest, res: NextApiResponse<Te
error,
});
} else if (method === "POST") {
- // FIXME: add userId as owner of the team
const safe = schemaTeamBodyParams.safeParse(req.body);
if (!safe.success) throw new Error("Invalid request body");
const team = await prisma.team.create({ data: safe.data });
+ // We're also creating the relation membership of team ownership in this call.
const membership = await prisma.membership
.create({
data: { userId, teamId: team.id, role: "OWNER", accepted: true },
})
.then((membership) => schemaMembershipPublic.parse(membership));
- // We're also creating the relation membership of team ownership in this call.
const data = schemaTeamPublic.parse(team);
// We are also returning the new ownership relation as owner besides team.
if (data)