test(api): harden assistant tool error handling
This commit is contained in:
@@ -619,6 +619,13 @@ export const notificationRouter = createTRPCRouter({
|
||||
senderId,
|
||||
);
|
||||
|
||||
if (recipientIds.length === 0) {
|
||||
throw new TRPCError({
|
||||
code: "BAD_REQUEST",
|
||||
message: "No recipients matched the broadcast target.",
|
||||
});
|
||||
}
|
||||
|
||||
// 4. Create individual notifications for each recipient
|
||||
const isTask = input.category === "TASK" || input.category === "APPROVAL";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user