From 617345ab99ecff2ecfdf1182999d131718de41f7 Mon Sep 17 00:00:00 2001 From: Oluwafemi Adenuga Date: Mon, 13 Nov 2023 11:39:43 +0100 Subject: [PATCH] Remove forward slashes from endpoints --- openproject/client.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/openproject/client.py b/openproject/client.py index 18dbe62..18d38a0 100644 --- a/openproject/client.py +++ b/openproject/client.py @@ -86,21 +86,21 @@ def _api_payload_from_kwargs(self, **kwargs: WorkPackage): return data def list(self): - return self.client._send_request("GET", "/work_packages") + return self.client._send_request("GET", "work_packages") def view(self, id: int): - return self.client._send_request("GET", f"/work_packages/{id}") + return self.client._send_request("GET", f"work_packages/{id}") def create(self, **kwargs): data = self._api_payload_from_kwargs(**kwargs) - return self.client._send_request("POST", "/work_packages", data=data) + return self.client._send_request("POST", "work_packages", data=data) def update(self, id: int, **kwargs): data = self._api_payload_from_kwargs(**kwargs) - return self.client._send_request("PATCH", f"/work_packages/{id}", data=data) + return self.client._send_request("PATCH", f"work_packages/{id}", data=data) def delete(self, id: int): - return self.client._send_request("DELETE", f"/work_packages/{id}") + return self.client._send_request("DELETE", f"work_packages/{id}") class Projects(SubClient): @@ -117,26 +117,26 @@ def _api_payload_from_kwargs(self, **kwargs: Project): return data def list(self): - return self.client._send_request("GET", "/projects") + return self.client._send_request("GET", "projects") def view(self, id: int): - return self.client._send_request("GET", f"/projects/{id}") + return self.client._send_request("GET", f"projects/{id}") def create(self, **kwargs): data = self._api_payload_from_kwargs(**kwargs) - return self.client._send_request("POST", "/projects", data=data) + return self.client._send_request("POST", "projects", data=data) def update(self, id: int, **kwargs): data = self._api_payload_from_kwargs(**kwargs) - return self.client._send_request("PATCH", f"/projects/{id}", data=data) + return self.client._send_request("PATCH", f"projects/{id}", data=data) def delete(self, id: int): - return self.client._send_request("DELETE", f"/projects/{id}") + return self.client._send_request("DELETE", f"projects/{id}") class Statuses(SubClient): def list(self): - return self.client._send_request("GET", "/statuses") + return self.client._send_request("GET", "statuses") def view(self, id: int): - return self.client._send_request("GET", f"/statuses/{id}") + return self.client._send_request("GET", f"statuses/{id}")