Auto-fill manual sessions from existing tickets
This commit is contained in:
1 parent
018c06dc3e
commit
2792051a16
2 files changed
+87
-6
No files matched your search
@@ -2785,7 +2785,7 @@ app.post("/api/sessions", requireUser, async (req, res) => {
|
||||
[ticketNumber]
|
||||
);
|
||||
const existingTicket = existingTicketResult.rows[0] ?? null;
|
||||
const effectiveOrganizationId = requestedOrganizationId ?? (existingTicket?.organization_id ? Number(existingTicket.organization_id) : null);
|
||||
const effectiveOrganizationId = existingTicket?.organization_id ? Number(existingTicket.organization_id) : requestedOrganizationId;
|
||||
|
||||
if (!effectiveOrganizationId) {
|
||||
throw badRequest("organizationId is required");
|
||||
@@ -2812,7 +2812,7 @@ app.post("/api/sessions", requireUser, async (req, res) => {
|
||||
);
|
||||
|
||||
const ticket = ticketResult.rows[0];
|
||||
const workType = requestedWorkType ?? ticket.work_type;
|
||||
const workType = ticket.work_type ?? requestedWorkType;
|
||||
|
||||
if (!workType) {
|
||||
throw badRequest("workType must be support or consulting");
|
||||
|
||||
Reference in new issue
Block a user