Fix response data

This commit is contained in:
amcmanu3 2023-06-04 17:47:56 -04:00
parent 2ebbb1fdab
commit 12088f1332
2 changed files with 12 additions and 2 deletions

View File

@ -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):

View File

@ -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()