fix: [api] default start/end for publisher and project fixed

main
Alexandre Dulaunoy 2021-05-25 10:32:15 +02:00
parent 3bb400c585
commit b9fc0114c7
No known key found for this signature in database
GPG Key ID: 09E2CD4944E6CBCD
1 changed files with 4 additions and 4 deletions

View File

@ -49,9 +49,9 @@ class favicon(Resource):
def get(self): def get(self):
return send_from_directory(os.path.join(app.root_path, 'static'),'favicon.ico',mimetype='image/vnd.microsoft.icon') return send_from_directory(os.path.join(app.root_path, 'static'),'favicon.ico',mimetype='image/vnd.microsoft.icon')
@api.route('/list/publisher/<int:start>/<int:end>', defaults={"start": 0, "end": 10}) @api.route('/list/publisher/<int:start>/<int:end>')
class list_publisher(Resource): class list_publisher(Resource):
def get(self, start=0, end=10): def get(self, start, end):
uuids = r.zrange('t:1', start, end) uuids = r.zrange('t:1', start, end)
publishers = [] publishers = []
for uuidvalue in uuids: for uuidvalue in uuids:
@ -59,9 +59,9 @@ class list_publisher(Resource):
publishers.append(_publisher) publishers.append(_publisher)
return publishers return publishers
@api.route('/list/project/<int:start>/<int:end>', defaults={"start": 0, "end": 10}) @api.route('/list/project/<int:start>/<int:end>')
class list_project(Resource): class list_project(Resource):
def get(self, start=0, end=10): def get(self, start, end):
uuids = r.zrange('t:2', start, end) uuids = r.zrange('t:2', start, end)
publishers = [] publishers = []
for uuidvalue in uuids: for uuidvalue in uuids: