mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-20 14:29:25 -04:00
Return template name in public API
The use for the public template API is for building caseworking systems or similar, where you might need a list of templates to pick from (ie instead of using the Notify web interface to pick from and send a message). Right now our API isn’t returning the template name as part of the response. The name is a useful, human-friendly way of identifying a template. This commit changes the response to include the name. Some clients will need updating before this can be useful.
This commit is contained in:
@@ -494,7 +494,8 @@ class Template(db.Model):
|
||||
"created_by": self.created_by.email_address,
|
||||
"version": self.version,
|
||||
"body": self.content,
|
||||
"subject": self.subject if self.template_type != SMS_TYPE else None
|
||||
"subject": self.subject if self.template_type != SMS_TYPE else None,
|
||||
"name": self.name,
|
||||
}
|
||||
|
||||
return serialized
|
||||
|
||||
@@ -35,9 +35,10 @@ get_template_by_id_response = {
|
||||
"created_by": {"type": "string"},
|
||||
"version": {"type": "integer"},
|
||||
"body": {"type": "string"},
|
||||
"subject": {"type": ["string", "null"]}
|
||||
"subject": {"type": ["string", "null"]},
|
||||
"name": {"type": "string"},
|
||||
},
|
||||
"required": ["id", "type", "created_at", "updated_at", "version", "created_by", "body"]
|
||||
"required": ["id", "type", "created_at", "updated_at", "version", "created_by", "body", "name"],
|
||||
}
|
||||
|
||||
post_template_preview_request = {
|
||||
|
||||
Reference in New Issue
Block a user