17 lines
468 B
Python
17 lines
468 B
Python
from flask import Blueprint, request, jsonify
|
|
from services import OrganizationService
|
|
|
|
org_bp = Blueprint("org", __name__)
|
|
|
|
@org_bp.route("/create", methods=["POST"])
|
|
def create():
|
|
data = request.json
|
|
org = OrganizationService.create_organization(
|
|
name=data["name"],
|
|
username=data["username"],
|
|
full_name=data["full_name"],
|
|
email=data["email"],
|
|
public_key=data["public_key"]
|
|
)
|
|
return jsonify(org.to_dict()), 201
|