コード例 #1
0
def add_search_workshop(id):
    user_company = User_company.get_by_id(id)

    body = request.get_json()

    new_search_workshop = Search_workshop(duration=body.get("duration"),
                                          max_price=body.get("price"),
                                          date=body.get("date"),
                                          max_people=body.get("max_people"),
                                          user_company_id=user_company.id,
                                          category_id=body.get("category_id"))

    new_search_workshop.add()

    return jsonify(new_search_workshop.to_dict()), 201
コード例 #2
0
def update_company_user(id):
    body = request.get_json()
    user = User_company.update_company_user(body, id)
    change_user = User_company.get_by_id(id)
    return jsonify(change_user.to_dict())