reading messages for inbox from new most_recent endpoint

avoids us having to work out and display most recent messages
only on the front-end - it's now all done in api
This commit is contained in:
chrisw
2018-04-04 15:57:31 +01:00
parent 1d32c766e8
commit 78d16709d6
4 changed files with 44 additions and 10 deletions

View File

@@ -238,7 +238,7 @@ def get_inbox_partials(service_id):
if 'inbound_sms' not in current_service['permissions']:
abort(403)
inbound_messages_data = service_api_client.get_inbound_sms(service_id, page=page)
inbound_messages_data = service_api_client.get_most_recent_inbound_sms(service_id, page=page)
inbound_messages = inbound_messages_data['data']
if not inbound_messages:

View File

@@ -272,6 +272,16 @@ class ServiceAPIClient(NotifyAdminAPIClient):
}
)
def get_most_recent_inbound_sms(self, service_id, page=None):
return self.get(
'/service/{}/inbound-sms/most-recent'.format(
service_id,
),
params={
'page': page
}
)
def get_inbound_sms_by_id(self, service_id, notification_id):
return self.get(
'/service/{}/inbound-sms/{}'.format(