aboutsummaryrefslogtreecommitdiff
path: root/gn2
diff options
context:
space:
mode:
authorAlexander_Kabui2024-08-29 10:10:22 +0300
committerAlexander_Kabui2024-08-29 11:55:47 +0300
commit6db49002d4d2e69fcf4fdd6be6aceeea7b95664f (patch)
tree5e2182b99f5f05e2f667dfce1b762921c4ec62dc /gn2
parent4cb622d16a47124417ba32fa7ac9fcb9f8d370bf (diff)
downloadgenenetwork2-6db49002d4d2e69fcf4fdd6be6aceeea7b95664f.tar.gz
Add delete to monad requests http methods.
Diffstat (limited to 'gn2')
-rw-r--r--gn2/wqflask/requests.py5
-rw-r--r--gn2/wqflask/views.py2
2 files changed, 6 insertions, 1 deletions
diff --git a/gn2/wqflask/requests.py b/gn2/wqflask/requests.py
index 16c56e13..182201a5 100644
--- a/gn2/wqflask/requests.py
+++ b/gn2/wqflask/requests.py
@@ -19,3 +19,8 @@ def post(url, data=None, json=None, **kwargs) -> Either:
def put(url, data=None, json=None, **kwargs) -> Either:
"""Wrap requests put method with Either monad"""
return __wrap_response__(requests.put(url, data=data, json=json, **kwargs))
+
+
+def delete(url, **kwargs) -> Either:
+ """Wrap requests delete method with Either monad"""
+ return __wrap_response__(requests.delete(url, **kwargs))
diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py
index 97247182..993c6f0c 100644
--- a/gn2/wqflask/views.py
+++ b/gn2/wqflask/views.py
@@ -299,7 +299,7 @@ def get_gnqa_history():
token = session_info()["user"]["token"].either(
lambda err: err, lambda tok: tok["access_token"])
if request.method == "DELETE":
- monad_requests.post(urljoin(GN3_LOCAL_URL, "/api/llm/history"),
+ monad_requests.delete(urljoin(GN3_LOCAL_URL, "/api/llm/history"),
json=dict(request.form),
headers={
"Authorization": f"Bearer {token}"