Add limit/offset to recipes/list
This commit is contained in:
parent
2cd4fcfd88
commit
1d53d00532
@ -66,7 +66,7 @@ def v0_api(api):
|
|||||||
return jsonify(error={"msg":str(e)}), 400
|
return jsonify(error={"msg":str(e)}), 400
|
||||||
|
|
||||||
with api.config["GITLOCK"].lock:
|
with api.config["GITLOCK"].lock:
|
||||||
recipes = map(lambda f: f[:-5], list_branch_files(api.config["GITLOCK"].repo, "master"))
|
recipes = take_limits(map(lambda f: f[:-5], list_branch_files(api.config["GITLOCK"].repo, "master")), offset, limit)
|
||||||
return jsonify(recipes=recipes, limit=limit, offset=offset, total=len(recipes))
|
return jsonify(recipes=recipes, limit=limit, offset=offset, total=len(recipes))
|
||||||
|
|
||||||
@api.route("/api/v0/recipes/info/<recipe_names>")
|
@api.route("/api/v0/recipes/info/<recipe_names>")
|
||||||
|
Loading…
Reference in New Issue
Block a user