mirror of
https://github.com/GSA/notifications-api.git
synced 2026-05-02 23:30:15 -04:00
add template folder CRUD
* create template folder * rename template folder * get list of template folders for service (not nested/presented in any particular way) * delete template folder Also removed `lazy=dynamic` from the `template_folder.templates` relationship. lazy=dynamic returns a query object (which you can then filter further). We just want to return the entire fetched list, at least for now.
This commit is contained in:
22
app/template_folder/template_folder_schema.py
Normal file
22
app/template_folder/template_folder_schema.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from app.schema_validation.definitions import nullable_uuid
|
||||
|
||||
post_create_template_folder_schema = {
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"description": "POST schema for getting template_folder",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {"type": "string", "minLength": 1},
|
||||
"parent_id": nullable_uuid
|
||||
},
|
||||
"required": ["name", "parent_id"]
|
||||
}
|
||||
|
||||
post_rename_template_folder_schema = {
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"description": "POST schema for renaming template_folder",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {"type": "string", "minLength": 1},
|
||||
},
|
||||
"required": ["name"]
|
||||
}
|
||||
Reference in New Issue
Block a user