delete method에서 HTTPS 409 제거
parent
eb252307e8
commit
347e567b95
|
|
@ -54,7 +54,7 @@ async def get_user_info_from_id(user_id:int):
|
||||||
raise HTTPException(status.HTTP_404_NOT_FOUND)
|
raise HTTPException(status.HTTP_404_NOT_FOUND)
|
||||||
return user_info
|
return user_info
|
||||||
|
|
||||||
async def get_user_id_from_name(user_name:str):
|
async def get_user_id_from_name(user_name:str):
|
||||||
async with await get_cnx() as cnx:
|
async with await get_cnx() as cnx:
|
||||||
async with await cnx.cursor() as cur:
|
async with await cnx.cursor() as cur:
|
||||||
query = '''
|
query = '''
|
||||||
|
|
@ -127,9 +127,6 @@ async def delete_user_from_id(user_id:int):
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
await cur.execute(query, data)
|
await cur.execute(query, data)
|
||||||
except IntegrityError as e:
|
|
||||||
await cnx.rollback()
|
|
||||||
raise HTTPException(status_code=status.HTTP_409_CONFLICT, detail="user already exist")
|
|
||||||
await cnx.commit()
|
await cnx.commit()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -230,9 +227,6 @@ async def delete_blog_from_id(blog_id:int):
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
await cur.execute(query, data)
|
await cur.execute(query, data)
|
||||||
except IntegrityError as e:
|
|
||||||
await cnx.rollback()
|
|
||||||
raise HTTPException(status_code=status.HTTP_409_CONFLICT, detail="already exist")
|
|
||||||
await cnx.commit()
|
await cnx.commit()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue