mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Updated the uploads page to include letters. Now the page shows uploaded letters plus jobs.
New units tests have not been written for this page because it is very like this will be refactor and probably a new template created for the page. Some design needs to go into this page. But we needed something ready for user research.
This commit is contained in:
@@ -61,6 +61,20 @@ class JobApiClient(NotifyAdminAPIClient):
|
||||
|
||||
return jobs
|
||||
|
||||
def get_uploads(self, service_id, limit_days=None, page=1):
|
||||
params = {'page': page}
|
||||
if limit_days is not None:
|
||||
params['limit_days'] = limit_days
|
||||
uploads = self.get(url='/service/{}/upload'.format(service_id), params=params)
|
||||
for upload in uploads['data']:
|
||||
stats = self.__convert_statistics(upload)
|
||||
upload['notifications_sent'] = stats['delivered'] + stats['failed']
|
||||
upload['notifications_delivered'] = stats['delivered']
|
||||
upload['notifications_failed'] = stats['failed']
|
||||
upload['notifications_requested'] = stats['requested']
|
||||
|
||||
return uploads
|
||||
|
||||
def has_sent_previously(self, service_id, template_id, template_version, original_file_name):
|
||||
return (
|
||||
template_id, template_version, original_file_name
|
||||
|
||||
Reference in New Issue
Block a user