From: Michael Tremer Date: Fri, 18 Jul 2025 16:58:17 +0000 (+0000) Subject: api: Fix creating watchers X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07a5befc918ffa8c91e06a7e9b238458466d7daa;p=pbs.git api: Fix creating watchers Signed-off-by: Michael Tremer --- diff --git a/src/api/builds.py b/src/api/builds.py index 3caaec00..fc43ebdc 100644 --- a/src/api/builds.py +++ b/src/api/builds.py @@ -143,10 +143,10 @@ async def add_watcher( """ # Add the current user as a watcher async with backend.db as session: - build.add_watcher(current_user) + await build.add_watcher(current_user) # Return 201 - return fastapi.Response(fastapi.status.HTTP_201_CREATED) + return fastapi.Response(status_code=fastapi.status.HTTP_201_CREATED) @router.delete("/{uuid}/watchers") async def remove_watcher( @@ -158,10 +158,10 @@ async def remove_watcher( """ # Remove the current user as a watcher async with backend.db as session: - build.remove_watcher(current_user) + await build.remove_watcher(current_user) # Return 204 - return fastapi.Response(fastapi.status.HTTP_204_NO_CONTENT) + return fastapi.Response(status_code=fastapi.status.HTTP_204_NO_CONTENT) # # Bugs