mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 09:45:28 +01:00
Fix response data
This commit is contained in:
parent
2ebbb1fdab
commit
12088f1332
@ -43,7 +43,11 @@ class ApiServersServerWebhooksIndexHandler(BaseApiHandler):
|
||||
# if the user doesn't have Schedule permission, return an error
|
||||
return self.finish_json(400, {"status": "error", "error": "NOT_AUTHORIZED"})
|
||||
self.finish_json(
|
||||
200, self.controller.management.get_webhooks_by_server(server_id)
|
||||
200,
|
||||
{
|
||||
"status": "ok",
|
||||
"data": self.controller.management.get_webhooks_by_server(server_id),
|
||||
},
|
||||
)
|
||||
|
||||
def post(self, server_id: str):
|
||||
|
@ -52,7 +52,13 @@ class ApiServersServerWebhooksWebhookIndexHandler(BaseApiHandler):
|
||||
return self.finish_json(
|
||||
400, {"status": "error", "error": "NO WEBHOOK FOUND"}
|
||||
)
|
||||
self.finish_json(200, self.controller.management.get_webhook_by_id(webhook_id))
|
||||
self.finish_json(
|
||||
200,
|
||||
{
|
||||
"status": "ok",
|
||||
"data": self.controller.management.get_webhook_by_id(webhook_id),
|
||||
},
|
||||
)
|
||||
|
||||
def delete(self, server_id: str, webhook_id: str):
|
||||
auth_data = self.authenticate_user()
|
||||
|
Loading…
x
Reference in New Issue
Block a user