Skip to content

Commit

Permalink
Remove forward slashes from endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Oluwafemi Adenuga authored Nov 13, 2023
2 parents b3d4f60 + 617345a commit c1a5570
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions openproject/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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}")

0 comments on commit c1a5570

Please sign in to comment.