]> git.ipfire.org Git - pbs.git/commitdiff
api: Fix creating watchers
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Jul 2025 16:58:17 +0000 (16:58 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Jul 2025 16:58:17 +0000 (16:58 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/api/builds.py

index 3caaec0026d6dff165041b5aaa43e83ced9f7ced..fc43ebdc1ea082a752d04a07d47e4a5d4a1b840e 100644 (file)
@@ -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