Update routes/support.py
Browse files- routes/support.py +3 -3
routes/support.py
CHANGED
@@ -128,16 +128,16 @@ async def get_user_tickets(
|
|
128 |
history.append(f"Assigned to {support_name} on {format_datetime(assigned_time)}")
|
129 |
|
130 |
# Status e última atualização (se necessário)
|
131 |
-
status = "
|
132 |
if ticket.get("finished"):
|
133 |
-
status = "
|
134 |
if ticket.get("finished_date"):
|
135 |
closed_dt = parser.isoparse(ticket["finished_date"])
|
136 |
history.append(f"Ticket closed on {closed_dt.strftime('%m/%d/%Y, %I:%M %p')}")
|
137 |
elif all_messages:
|
138 |
last_msg = all_messages[-1]
|
139 |
if last_msg["user"] != user_id:
|
140 |
-
status = "
|
141 |
else:
|
142 |
last_msg_time = format_datetime(last_msg["created_at"])
|
143 |
history.append(f"Last updated on {last_msg_time}")
|
|
|
128 |
history.append(f"Assigned to {support_name} on {format_datetime(assigned_time)}")
|
129 |
|
130 |
# Status e última atualização (se necessário)
|
131 |
+
status = "Open"
|
132 |
if ticket.get("finished"):
|
133 |
+
status = "Closed"
|
134 |
if ticket.get("finished_date"):
|
135 |
closed_dt = parser.isoparse(ticket["finished_date"])
|
136 |
history.append(f"Ticket closed on {closed_dt.strftime('%m/%d/%Y, %I:%M %p')}")
|
137 |
elif all_messages:
|
138 |
last_msg = all_messages[-1]
|
139 |
if last_msg["user"] != user_id:
|
140 |
+
status = "Answered"
|
141 |
else:
|
142 |
last_msg_time = format_datetime(last_msg["created_at"])
|
143 |
history.append(f"Last updated on {last_msg_time}")
|