7.80.0 — Émission d'événements vers le journal du service d'agents (Lot 2)
This commit is contained in:
@@ -118,6 +118,9 @@ def create_collection_api(request: Request, body: dict = Body(default={})):
|
||||
conn.commit()
|
||||
|
||||
run_event_sync(fire_event("collection.created", {"collection_id": collection_id, "name": name, "icon": icon}))
|
||||
from app.services.agent_evenements import emettre, url_collection
|
||||
emettre("flowdeck.collection.created", f"collection:{collection_id}", name,
|
||||
url=url_collection(collection_id), actor="user")
|
||||
return {"id": collection_id, "name": name, "status": "created"}
|
||||
|
||||
|
||||
|
||||
@@ -119,4 +119,7 @@ def create_page_api(request: Request, collection_id: int, body: dict = Body(defa
|
||||
"collection_id": collection_id,
|
||||
"title": title,
|
||||
}))
|
||||
from app.services.agent_evenements import emettre, url_collection
|
||||
emettre("flowdeck.page.created", f"page:{page_id}", title,
|
||||
url=url_collection(collection_id), actor="user")
|
||||
return {"id": page_id, "title": title, "status": "created"}
|
||||
|
||||
@@ -149,6 +149,9 @@ def update_page_api(request: Request, page_id: int, body: dict = Body(default={}
|
||||
user = _current_user(request)
|
||||
notify_assignment(existing["collection_id"], page_id, title,
|
||||
stored, props, user.get("id"))
|
||||
from app.services.agent_evenements import emettre, url_collection
|
||||
emettre("flowdeck.page.updated", f"page:{page_id}", title,
|
||||
url=url_collection(existing["collection_id"]), actor="user")
|
||||
return {"id": page_id, "status": "updated"}
|
||||
|
||||
|
||||
@@ -178,6 +181,9 @@ def delete_page_api(request: Request, page_id: int):
|
||||
"page_id": page_id,
|
||||
"collection_id": existing["collection_id"],
|
||||
}))
|
||||
from app.services.agent_evenements import emettre, url_collection
|
||||
emettre("flowdeck.page.deleted", f"page:{page_id}", existing["title"],
|
||||
url=url_collection(existing["collection_id"]), actor="user")
|
||||
return {"id": page_id, "status": "deleted"}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user