Skip to content

Commit

Permalink
Use client to retrieve path
Browse files Browse the repository at this point in the history
Co-Authored-By: Taylor Steinberg <[email protected]>
  • Loading branch information
schloerke and tdstein committed Dec 13, 2024
1 parent 08caf8d commit edf0675
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/posit/connect/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,8 @@ def destroy(self, **kwargs) -> Task | None:
task.wait_for()
```
"""
url = self._ctx.url + self._path
data = dict(self)
response = self._ctx.session.delete(url, json={**data, **kwargs})
body = {**self, **kwargs}
response = self._ctx.client.delete(self._path, json=body)

task_id = response.json().get("task_id")
if not task_id:
Expand Down Expand Up @@ -191,8 +190,7 @@ def find(self) -> List[SystemRuntimeCache]:
runtime_caches = client.system.caches.runtime.find()
```
"""
url = self._ctx.url + self._path
response = self._ctx.session.get(url)
response = self._ctx.client.get(self._path)
results = response.json()
if not isinstance(results, dict) and "caches" not in results:
raise RuntimeError("`caches=` not found in response.")
Expand Down

0 comments on commit edf0675

Please sign in to comment.