fix(api): harden notification assignee persistence
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user