Adicão da rota de despesas, agora atualizando
This commit is contained in:
parent
9aad6ff8f4
commit
e9a98424bd
2 changed files with 34 additions and 9 deletions
|
|
@ -20,18 +20,13 @@ def inserir_nota_despesas(
|
|||
repo = NotasDespesas(conexao)
|
||||
|
||||
try:
|
||||
inseriu = repo.inserir_nota_despesas(dados_nota_holmes)
|
||||
acao = repo.inserir_nota_despesas(dados_nota_holmes)
|
||||
except ValueError as erro:
|
||||
raise HTTPException(
|
||||
status_code= status.HTTP_422_UNPROCESSABLE_ENTITY,
|
||||
detail= str(erro)
|
||||
)
|
||||
|
||||
if not inseriu:
|
||||
raise HTTPException(
|
||||
status_code= status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
detail= "Não foi possível inserir a nota"
|
||||
)
|
||||
return {
|
||||
'mensagem': 'Nota inserida'
|
||||
'mensagem': f'Nota {acao}'
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue