jedna kategoria dla listy
This commit is contained in:
20
app.py
20
app.py
@@ -2971,6 +2971,26 @@ def admin_mass_edit_categories():
|
||||
"admin/mass_edit_categories.html", lists=lists, categories=categories
|
||||
)
|
||||
|
||||
@app.route("/admin/list_items/<int:list_id>")
|
||||
@login_required
|
||||
@admin_required
|
||||
def admin_list_items_json(list_id):
|
||||
l = db.session.get(ShoppingList, list_id)
|
||||
if not l:
|
||||
return jsonify({"error": "Lista nie istnieje"}), 404
|
||||
|
||||
items = [
|
||||
{
|
||||
"name": item.name,
|
||||
"quantity": item.quantity,
|
||||
"purchased": item.purchased,
|
||||
"not_purchased": item.not_purchased,
|
||||
}
|
||||
for item in l.items
|
||||
]
|
||||
|
||||
return jsonify({"title": l.title, "items": items})
|
||||
|
||||
|
||||
@app.route("/healthcheck")
|
||||
def healthcheck():
|
||||
|
Reference in New Issue
Block a user