api: fix response generation with new "is_main_lock" field
All checks were successful
Build Container / Build Container (push) Successful in 4m25s
All checks were successful
Build Container / Build Container (push) Successful in 4m25s
This commit is contained in:
parent
ecd6c2c48f
commit
51c67c49ae
2 changed files with 7 additions and 1 deletions
|
|
@ -233,11 +233,17 @@ async def list_locks(ccujack: deps.CCUJackClient) -> List[models.Lock]:
|
|||
case "UNREACH":
|
||||
status_data["is_unreachable"] = value.v
|
||||
|
||||
main_lock = app_config.get().main_lock or ""
|
||||
is_main_lock = (
|
||||
i_lock.identifier.lower() == main_lock.lower()
|
||||
or i_lock.title.lower() == main_lock.lower()
|
||||
)
|
||||
result.append(
|
||||
models.Lock(
|
||||
id=i_lock.identifier,
|
||||
name=i_lock.title,
|
||||
status=models.LockStatus(**status_data),
|
||||
is_main_lock=is_main_lock,
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue