feat(domain): complete phase 2 backend core

This commit is contained in:
poyrazavsever
2026-07-16 16:46:42 +03:00
parent 92bc99ba12
commit b155132acf
28 changed files with 5343 additions and 30 deletions
+8 -1
View File
@@ -31,7 +31,14 @@ export async function POST(request: Request) {
function invitationErrorResponse(error: unknown) {
if (error instanceof PortalInvitationError) {
const status = error.code === "FORBIDDEN" ? 403 : error.code === "INVALID_INPUT" ? 400 : 409;
const status =
error.code === "FORBIDDEN"
? 403
: error.code === "INVALID_INPUT"
? 400
: error.code === "CLIENT_NOT_FOUND"
? 404
: 409;
return NextResponse.json({ error: error.message, code: error.code }, { status });
}