mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
Added endpoints for letter-branding.
This commit is contained in:
@@ -214,7 +214,7 @@ def register_blueprint(application):
|
||||
template_folder_blueprint.before_request(requires_admin_auth)
|
||||
application.register_blueprint(template_folder_blueprint)
|
||||
|
||||
letter_branding_blueprint.before_request(requires_admin_auth())
|
||||
letter_branding_blueprint.before_request(requires_admin_auth)
|
||||
application.register_blueprint(letter_branding_blueprint)
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ from app.letter_branding.letter_branding_schema import post_letter_branding_sche
|
||||
from app.models import LetterBranding
|
||||
from app.schema_validation import validate
|
||||
|
||||
letter_branding_blueprint = Blueprint('letter_branding', __name__, url_prefix='letter-branding')
|
||||
letter_branding_blueprint = Blueprint('letter_branding', __name__, url_prefix='/letter-branding')
|
||||
register_errors(letter_branding_blueprint)
|
||||
|
||||
|
||||
@@ -65,12 +65,12 @@ def create_letter_brand():
|
||||
return jsonify(letter_branding.serialize()), 201
|
||||
|
||||
|
||||
@letter_branding_blueprint.route('/<uuid: letter_branding_id>', methods=['POST'])
|
||||
def create_letter_branding(letter_branding_id):
|
||||
@letter_branding_blueprint.route('/<uuid:letter_branding_id>', methods=['POST'])
|
||||
def update_letter_branding(letter_branding_id):
|
||||
data = request.get_json()
|
||||
|
||||
validate(data, post_letter_branding_schema)
|
||||
|
||||
letter_branding = dao_update_letter_branding(letter_branding_id, )
|
||||
letter_branding = dao_update_letter_branding(letter_branding_id, **data)
|
||||
|
||||
return jsonify(letter_branding.serialize()), 201
|
||||
|
||||
@@ -7,5 +7,8 @@ post_letter_branding_schema = {
|
||||
"filename": {"type": ["string", "null"]},
|
||||
"domain": {"type": ["string", "null"]},
|
||||
},
|
||||
"required": ("name", "filename", "domain")
|
||||
"required": ("name", "filename", "domain"),
|
||||
# Typically we allow additional properties but we don't want to update letter_branding platform_admin,
|
||||
# this can handle this without adding extra code in the rest endpoint.
|
||||
"additionalProperties": False
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user