This commit is contained in:
@@ -69,7 +69,7 @@ def create_occasional_dict(contract_products: list[models.ContractProduct]):
|
||||
)
|
||||
return result
|
||||
|
||||
@router.post('/')
|
||||
@router.post('')
|
||||
async def create_contract(
|
||||
contract: models.ContractCreate,
|
||||
session: Session = Depends(get_session),
|
||||
@@ -107,7 +107,7 @@ async def create_contract(
|
||||
}
|
||||
)
|
||||
|
||||
@router.get('/', response_model=list[models.ContractPublic])
|
||||
@router.get('', response_model=list[models.ContractPublic])
|
||||
def get_contracts(
|
||||
forms: list[str] = Query([]),
|
||||
session: Session = Depends(get_session),
|
||||
@@ -115,7 +115,7 @@ def get_contracts(
|
||||
):
|
||||
return service.get_all(session, user, forms)
|
||||
|
||||
@router.get('/{id}/file')
|
||||
@router.get('{id}/file')
|
||||
def get_contract_file(
|
||||
id: int,
|
||||
session: Session = Depends(get_session),
|
||||
@@ -135,7 +135,7 @@ def get_contract_file(
|
||||
}
|
||||
)
|
||||
|
||||
@router.get('/{form_id}/files')
|
||||
@router.get('{form_id}/files')
|
||||
def get_contract_files(
|
||||
form_id: int,
|
||||
session: Session = Depends(get_session),
|
||||
@@ -160,7 +160,7 @@ def get_contract_files(
|
||||
}
|
||||
)
|
||||
|
||||
@router.get('/{form_id}/recap')
|
||||
@router.get('{form_id}/recap')
|
||||
def get_contract_recap(
|
||||
form_id: int,
|
||||
session: Session = Depends(get_session),
|
||||
@@ -179,7 +179,7 @@ def get_contract_recap(
|
||||
}
|
||||
)
|
||||
|
||||
@router.get('/{id}', response_model=models.ContractPublic)
|
||||
@router.get('{id}', response_model=models.ContractPublic)
|
||||
def get_contract(id: int, session: Session = Depends(get_session), user: models.User = Depends(get_current_user)):
|
||||
if not service.is_allowed(session, user, id):
|
||||
raise HTTPException(status_code=403, detail=messages.notallowed)
|
||||
@@ -188,7 +188,7 @@ def get_contract(id: int, session: Session = Depends(get_session), user: models.
|
||||
raise HTTPException(status_code=404, detail=messages.notfound)
|
||||
return result
|
||||
|
||||
@router.delete('/{id}', response_model=models.ContractPublic)
|
||||
@router.delete('{id}', response_model=models.ContractPublic)
|
||||
def delete_contract(id: int, session: Session = Depends(get_session), user: models.User = Depends(get_current_user)):
|
||||
if not service.is_allowed(session, user, id):
|
||||
raise HTTPException(status_code=403, detail=messages.notallowed)
|
||||
|
||||
Reference in New Issue
Block a user