This commit is contained in:
aarizona 2024-05-02 13:08:58 +03:00
parent 7a395c14b1
commit f0af5af3e8
3 changed files with 9 additions and 10 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
.vscode/
__pycache__/
poetry.lock
.env

View File

@ -1,5 +1,5 @@
import os
import logging
import uuid
from dotenv import load_dotenv
load_dotenv()
@ -9,3 +9,5 @@ logging.basicConfig(
)
logging.getLogger("httpx").setLevel(logging.WARNING)
logger = logging.getLogger(__name__)
WEBHOOK = os.getenv('WEBHOOK')

View File

@ -1,7 +1,8 @@
from typing import Union
from fastapi import FastAPI
import requests
import json
from fastapi import FastAPI, Request
from app.constants import logger
from app.constants import *
app = FastAPI()
@ -12,10 +13,6 @@ def read_root():
@app.post("/integration")
<<<<<<< Updated upstream
def intgr(body):
logger.info(body)
=======
async def intgr(request: Request):
body = await request.json()
ref = body["ref"]
@ -37,5 +34,4 @@ async def intgr(request: Request):
f"&fields[POST_MESSAGE]={bx_comment}"
)
logger.info(f"result {json.loads(bx_res.text)}")
>>>>>>> Stashed changes
return {"status": "success"}