Exemplo n.º 1
0
def update_shippers():
    cn_db = db_ship.shippers(con_db)
    data = request.json
    ship1 = ship.shippers(data['shipper_id'], data['company_name'],
                          data['phone'])
    rs = cn_db.update(ship1)
    return jsonify({'message': rs}), 200
Exemplo n.º 2
0
def insert_shippers():
    cn_db = db_ship.shippers(con_db)
    data = request.json
    ship1 = ship.shippers(1, data['company_name'], data['phone'])
    rs = cn_db.insert(ship1)
    return jsonify({'message': rs}), 200
Exemplo n.º 3
0
def one_shippers(shipper_id):
    c = ship.shippers(shipper_id=shipper_id)
    rs = db_ship.shippers(con_db).get_by_id(c)
    if rs[1] != 200:
        return jsonify({'message': rs[0]}), rs[1]
    return jsonify({'message': rs[0].to_json()}), 200
Exemplo n.º 4
0
def delete_shippers(shipper_id):
    cn_db = db_ship.shippers(con_db)
    rs = cn_db.delete(shipper_id)
    return jsonify({'message': rs}), 200
Exemplo n.º 5
0
def all_shippers():
    result = db_ship.shippers(con_db).get_all()
    return jsonify({'data': result}), 200