Show letter preview once file is uploaded

This shows the sanitised letter preview if the file had no validation
errors or the preview with the overlay if it failed validation.
This commit is contained in:
Katie Smith
2019-09-09 10:59:32 +01:00
parent 8a322b844b
commit 7368245c9a
9 changed files with 228 additions and 6 deletions

View File

@@ -261,6 +261,12 @@ class ServiceAPIClient(NotifyAdminAPIClient):
)
return self.get(endpoint)
def get_precompiled_template(self, service_id):
"""
Returns the precompiled template for a service, creating it if it doesn't already exist
"""
return self.get('/service/{}/template/precompiled'.format(service_id))
@cache.set('service-{service_id}-templates')
def get_service_templates(self, service_id):
"""