示例#1
0
def delete(id):
    garanta = Validacoes()
    results = garanta.id_existe(id)
    if not results:
        return '', HTTPStatus.NOT_FOUND
    link = Links()
    link.delete_url(id)
    return '', HTTPStatus.OK
示例#2
0
def deletarUser(id):
    garanta = Validacoes()
    if not garanta.user_existe(id=id):
        return 'User não existe', HTTPStatus.NOT_FOUND

    links = Links()
    if garanta.existe_url_do_usuario(id):
        links.delete_url(id_usuario=id)

    user = Users()
    user.deletarUser(id)

    return '', HTTPStatus.OK