Fix argument in register_api() in docs/view.rst (#4818)
This commit is contained in:
parent
2c78771238
commit
9c3deeee96
1 changed files with 1 additions and 1 deletions
|
|
@ -297,7 +297,7 @@ provide get (list) and post (create) methods.
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
return jsonify(item.to_json())
|
return jsonify(item.to_json())
|
||||||
|
|
||||||
def register_api(app, model, url):
|
def register_api(app, model, name):
|
||||||
item = ItemAPI.as_view(f"{name}-item", model)
|
item = ItemAPI.as_view(f"{name}-item", model)
|
||||||
group = GroupAPI.as_view(f"{name}-group", model)
|
group = GroupAPI.as_view(f"{name}-group", model)
|
||||||
app.add_url_rule(f"/{name}/<int:id>", view_func=item)
|
app.add_url_rule(f"/{name}/<int:id>", view_func=item)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue