Merge pull request #1180 from alphagov/return-template-name

Return template name in public API
This commit is contained in:
Chris Hill-Scott
2017-08-17 12:44:24 +01:00
committed by GitHub
5 changed files with 57 additions and 25 deletions

View File

@@ -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

View File

@@ -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 = {