This commit is contained in:
parent
6c7f269206
commit
92791efa9c
|
@ -50,8 +50,6 @@ async def update_chat(_, info, chat_new: ChatUpdate):
|
||||||
@login_required
|
@login_required
|
||||||
async def create_chat(_, info, title="", members=None):
|
async def create_chat(_, info, title="", members=None):
|
||||||
members = members or []
|
members = members or []
|
||||||
print("create_chat members: %r" % members)
|
|
||||||
print("create_chat context: %r" % info.context)
|
|
||||||
user_id = info.context["user_id"]
|
user_id = info.context["user_id"]
|
||||||
authors_by_user, authors_by_id = get_all_authors()
|
authors_by_user, authors_by_id = get_all_authors()
|
||||||
author = authors_by_user[user_id]
|
author = authors_by_user[user_id]
|
||||||
|
|
|
@ -7,10 +7,15 @@ from settings import API_BASE
|
||||||
|
|
||||||
|
|
||||||
@lru_cache(maxsize=128, typed=True)
|
@lru_cache(maxsize=128, typed=True)
|
||||||
def _request_endpoint(query_name, body) -> Any:
|
def __request_endpoint(query_name, body) -> requests.Response:
|
||||||
print(f"[services.core] requesting {query_name}...")
|
print(f"[services.core] requesting {query_name}...")
|
||||||
response = requests.post(API_BASE, headers={"Content-Type": "application/json"}, json=body)
|
response = requests.post(API_BASE, headers={"Content-Type": "application/json"}, json=body)
|
||||||
print(f"[services.core] {query_name} response: <{response.status_code}> {response.text[:65]}..")
|
print(f"[services.core] {query_name} response: <{response.status_code}> {response.text[:65]}..")
|
||||||
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
def _request_endpoint(query_name, body) -> Any:
|
||||||
|
response = __request_endpoint(query_name, body)
|
||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user