fix: 500 error on missing response id. Should be 400 (#20420)
* fix: 500 error on missing response id. Should be 400 * fix failing test
This commit is contained in:
@@ -456,6 +456,10 @@ async function handler(
|
||||
let routingFormResponse = null;
|
||||
|
||||
if (routedTeamMemberIds) {
|
||||
//routingFormResponseId could be 0 for dry run. So, we just avoid undefined value
|
||||
if (routingFormResponseId === undefined) {
|
||||
throw new HttpError({ statusCode: 400, message: "Missing routingFormResponseId" });
|
||||
}
|
||||
routingFormResponse = await prisma.app_RoutingForms_FormResponse.findUnique({
|
||||
where: {
|
||||
id: routingFormResponseId,
|
||||
|
||||
@@ -2638,6 +2638,7 @@ describe("handleNewBooking", () => {
|
||||
start: `${plus1DateString}T04:00:00.000Z`,
|
||||
end: `${plus1DateString}T04:15:00.000Z`,
|
||||
routedTeamMemberIds: [101],
|
||||
routingFormResponseId: 12323,
|
||||
responses: {
|
||||
email: booker.email,
|
||||
name: booker.name,
|
||||
|
||||
Reference in New Issue
Block a user