increase page size for API calls to 250

This commit is contained in:
Rebecca Law
2017-01-20 12:26:55 +00:00
parent 645a6fb3cf
commit 8ed0979251
4 changed files with 461 additions and 497 deletions

View File

@@ -68,6 +68,7 @@ class Config(object):
SQLALCHEMY_RECORD_QUERIES = True SQLALCHEMY_RECORD_QUERIES = True
SQLALCHEMY_TRACK_MODIFICATIONS = True SQLALCHEMY_TRACK_MODIFICATIONS = True
PAGE_SIZE = 50 PAGE_SIZE = 50
API_PAGE_SIZE = 250
SMS_CHAR_COUNT_LIMIT = 495 SMS_CHAR_COUNT_LIMIT = 495
BRANDING_PATH = '/images/email-template/crests/' BRANDING_PATH = '/images/email-template/crests/'
TEST_MESSAGE_FILENAME = 'Test message' TEST_MESSAGE_FILENAME = 'Test message'

View File

@@ -175,7 +175,7 @@ def get_all_notifications():
data = notifications_filter_schema.load(request.args).data data = notifications_filter_schema.load(request.args).data
include_jobs = data.get('include_jobs', False) include_jobs = data.get('include_jobs', False)
page = data.get('page', 1) page = data.get('page', 1)
page_size = data.get('page_size', current_app.config.get('PAGE_SIZE')) page_size = data.get('page_size', current_app.config.get('API_PAGE_SIZE'))
limit_days = data.get('limit_days') limit_days = data.get('limit_days')
pagination = notifications_dao.get_notifications_for_service( pagination = notifications_dao.get_notifications_for_service(

View File

@@ -1,6 +1,6 @@
import uuid import uuid
from flask import jsonify, request, url_for from flask import jsonify, request, url_for, current_app
from werkzeug.exceptions import abort from werkzeug.exceptions import abort
from app import api_user from app import api_user
@@ -43,7 +43,8 @@ def get_notifications():
key_type=api_user.key_type, key_type=api_user.key_type,
personalisation=True, personalisation=True,
older_than=data.get('older_than'), older_than=data.get('older_than'),
client_reference=data.get('reference') client_reference=data.get('reference'),
page_size=current_app.config.get('API_PAGE_SIZE')
) )
def _build_links(notifications): def _build_links(notifications):

File diff suppressed because it is too large Load Diff