def METHOD_NAME(client_id):
    form = EditClientForm()
    approval_form = ApprovalClientForm()
    is_new = "is_new" in request.args
    action = request.args.get("action")
    client = Client.get(client_id)
    if not client or client.user_id != current_user.id:
        flash("you cannot see this app", "warning")
        return redirect(url_for("developer.index"))
    # can't set value for a textarea field in jinja
    if request.method == "GET":
        approval_form.description.data = client.description
    if action == "edit" and form.validate_on_submit():
        client.name = form.name.data
        client.home_url = form.url.data
        if form.icon.data:
            # todo: remove current icon if any
            # todo: handle remove icon
            file_path = random_string(30)
            file = File.create(path=file_path, user_id=client.user_id)
            s3.upload_from_bytesio(file_path, BytesIO(form.icon.data.read()))
            Session.flush()
            LOG.d("upload file %s to s3", file)
            client.icon_id = file.id
            Session.flush()
        Session.commit()
        flash(f"{client.name} has been updated", "success")
        return redirect(url_for("developer.client_detail", client_id=client.id))
    if action == "submit" and approval_form.validate_on_submit():
        client.description = approval_form.description.data
        Session.commit()
        send_email(
            ADMIN_EMAIL,
            subject=f"{client.name} {client.id} submits for approval",
            plaintext="",
            html=f"""
            name: {client.name} <br>
            created: {client.created_at} <br>
            user: {current_user.email} <br>
            <br>
            {client.description}
            """,
        )
        flash(
            f"Thanks for submitting, we are informed and will come back to you asap!",
            "success",
        )
        return redirect(url_for("developer.client_detail", client_id=client.id))
    return render_template(
        "developer/client_details/basic_info.html",
        form=form,
        approval_form=approval_form,
        client=client,
        is_new=is_new,
    )