fix: reorder notification DELETE routes so bulk clear matches first
FastAPI matches routes in declaration order. The DELETE /notifications
endpoint (bulk clear) was registered AFTER DELETE /notifications/{id},
so the path parameter route intercepted all requests to the bulk route,
causing a 422 UUID validation error instead of hitting clear_all.
Moved clear_all_notifications above dismiss_notification in the router.
Added regression test to verify route order.
Quality gates: pytest (22 passed)
This commit is contained in:
@@ -139,11 +139,7 @@ async def publish_lifecycle_event(
|
||||
if not _should_notify(event_type, effective_status):
|
||||
return
|
||||
|
||||
severity = (
|
||||
"error"
|
||||
if event_type == "instance.error"
|
||||
else "success"
|
||||
)
|
||||
severity = "error" if event_type == "instance.error" else "success"
|
||||
title = _derive_title(event_type)
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user