Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Fix: error message https://github.com/coollabsio/coolify/issues/502

Jesper Ordrup427d73c3ed91
diff --git a/apps/api/src/routes/api/v1/iam/handlers.ts b/apps/api/src/routes/api/v1/iam/handlers.ts
index 7009ec794c..72d6487931 100644
--- a/apps/api/src/routes/api/v1/iam/handlers.ts
+++ b/apps/api/src/routes/api/v1/iam/handlers.ts
@@ -273,11 +273,15 @@ export async function inviteToTeam(request: FastifyRequest<InviteToTeam>, reply:
const { email, permission, teamId, teamName } = request.body;
const userFound = await prisma.user.findUnique({ where: { email } });
if (!userFound) {
- throw `No user found with '${email}' email address.`
+ throw {
+ message: `No user found with '${email}' email address.`
+ };
}
const uid = userFound.id;
- if (uid === userId) {
- throw `Invitation to yourself? Whaaaaat?`
+ if (uid === userId) {
+ throw {
+ message: `Invitation to yourself? Whaaaaat?`
+ };
}
const alreadyInTeam = await prisma.team.findFirst({
where: { id: teamId, users: { some: { id: uid } } }