mirror of
https://github.com/norohind/jubilant-system-core.git
synced 2026-10-22 14:52:09 +03:00
Introduce hooks support
This commit is contained in:
4 files changed
+85
No files matched your search
@@ -1,5 +1,8 @@
|
||||
from . import Queries
|
||||
import DB
|
||||
import HookSystem
|
||||
|
||||
hook_system = HookSystem.HookSystem()
|
||||
|
||||
|
||||
def update_squad(squad_id: int, suppress_absence=False) -> None | int:
|
||||
@@ -15,10 +18,12 @@ def update_squad(squad_id: int, suppress_absence=False) -> None | int:
|
||||
# Squad not found FDEV
|
||||
if not suppress_absence:
|
||||
operation_id = DB.delete_squadron(squad_id)
|
||||
hook_system.notify_deleted(operation_id)
|
||||
|
||||
else:
|
||||
# Then we got valid squad_info dict
|
||||
news_info = Queries.get_squad_news(squad_id)
|
||||
operation_id = DB.insert_info_news(news_info, squad_info)
|
||||
hook_system.notify_inserted(operation_id)
|
||||
|
||||
return operation_id
|
||||
Reference in new issue
Block a user