fix(api): harden notification assignee persistence

This commit is contained in:
2026-03-31 22:52:09 +02:00
parent 7ace137d16
commit 6e84b022c3
5 changed files with 127 additions and 8 deletions
@@ -93,6 +93,18 @@ export function rethrowNotificationReferenceError(error: unknown): never {
? candidate.meta.modelName.toLowerCase()
: "";
if (
typeof candidate.code === "string"
&& (candidate.code === "P2003" || candidate.code === "P2025")
&& fieldName.includes("assignee")
) {
throw new TRPCError({
code: "NOT_FOUND",
message: "Assignee user not found",
cause: error,
});
}
if (
typeof candidate.code === "string"
&& (candidate.code === "P2003" || candidate.code === "P2025")