From 9ebaf3855368b24c4d2e924cae7b379137f965ab Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Sun, 26 May 2024 20:59:58 -0400 Subject: [PATCH] Fix files methods --- app/classes/web/routes/api/api_handlers.py | 10 +++++----- app/classes/web/routes/api/servers/server/files.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/classes/web/routes/api/api_handlers.py b/app/classes/web/routes/api/api_handlers.py index e6646c9e..b6911661 100644 --- a/app/classes/web/routes/api/api_handlers.py +++ b/app/classes/web/routes/api/api_handlers.py @@ -228,11 +228,6 @@ def api_handlers(handler_args): ApiServersServerBackupsBackupFilesIndexHandler, handler_args, ), - ( - r"/api/v2/servers/([a-z0-9-]+)/files(?:/([a-zA-Z0-9-]+))?/?", - ApiServersServerFilesIndexHandler, - handler_args, - ), ( r"/api/v2/servers/([a-z0-9-]+)/files/create/?", ApiServersServerFilesCreateHandler, @@ -243,6 +238,11 @@ def api_handlers(handler_args): ApiServersServerFilesZipHandler, handler_args, ), + ( + r"/api/v2/servers/([a-z0-9-]+)/files(?:/([a-zA-Z0-9-]+))?/?", + ApiServersServerFilesIndexHandler, + handler_args, + ), ( r"/api/v2/servers/([a-z0-9-]+)/tasks/?", ApiServersServerTasksIndexHandler, diff --git a/app/classes/web/routes/api/servers/server/files.py b/app/classes/web/routes/api/servers/server/files.py index 6e864a69..2699ae0c 100644 --- a/app/classes/web/routes/api/servers/server/files.py +++ b/app/classes/web/routes/api/servers/server/files.py @@ -203,7 +203,7 @@ class ApiServersServerFilesIndexHandler(BaseApiHandler): ) self.finish_json(200, {"status": "ok", "data": file_contents}) - def delete(self, server_id: str): + def delete(self, server_id: str, _backup_id=None): auth_data = self.authenticate_user() if not auth_data: return @@ -261,7 +261,7 @@ class ApiServersServerFilesIndexHandler(BaseApiHandler): return self.finish_json(200, {"status": "ok"}) return self.finish_json(500, {"status": "error", "error": str(proc)}) - def patch(self, server_id: str): + def patch(self, server_id: str, _backup_id): auth_data = self.authenticate_user() if not auth_data: return @@ -315,7 +315,7 @@ class ApiServersServerFilesIndexHandler(BaseApiHandler): file_object.write(file_contents) return self.finish_json(200, {"status": "ok"}) - def put(self, server_id: str): + def put(self, server_id: str, _backup_id): auth_data = self.authenticate_user() if not auth_data: return