Sort inventory-related queries and fix toast message syntax in inventory template
This commit is contained in:
parent
bb564809ea
commit
1ba0380dde
2 changed files with 5 additions and 5 deletions
|
@ -89,12 +89,12 @@ def inventory_item(id):
|
||||||
|
|
||||||
inventory_query = db.session.query(Inventory)
|
inventory_query = db.session.query(Inventory)
|
||||||
item = eager_load_inventory_relationships(inventory_query).filter(Inventory.id == id).first()
|
item = eager_load_inventory_relationships(inventory_query).filter(Inventory.id == id).first()
|
||||||
brands = db.session.query(Brand).all()
|
brands = db.session.query(Brand).order_by(Brand.name).all()
|
||||||
users = eager_load_user_relationships(db.session.query(User)).all()
|
users = eager_load_user_relationships(db.session.query(User).order_by(User.first_name)).all()
|
||||||
rooms = eager_load_room_relationships(db.session.query(Room)).all()
|
rooms = eager_load_room_relationships(db.session.query(Room).order_by(Room.name)).all()
|
||||||
worklog_query = db.session.query(WorkLog).filter(WorkLog.work_item_id == id)
|
worklog_query = db.session.query(WorkLog).filter(WorkLog.work_item_id == id)
|
||||||
worklog = eager_load_worklog_relationships(worklog_query).all()
|
worklog = eager_load_worklog_relationships(worklog_query).all()
|
||||||
types = db.session.query(Item).all()
|
types = db.session.query(Item).order_by(Item.description).all()
|
||||||
filtered_worklog_headers = {k: v for k, v in worklog_headers.items() if k not in ['Work Item', 'Contact', 'Follow Up?', 'Quick Analysis?']}
|
filtered_worklog_headers = {k: v for k, v in worklog_headers.items() if k not in ['Work Item', 'Contact', 'Follow Up?', 'Quick Analysis?']}
|
||||||
|
|
||||||
if item:
|
if item:
|
||||||
|
|
|
@ -191,7 +191,7 @@
|
||||||
const id = document.querySelector("#inventoryId").value;
|
const id = document.querySelector("#inventoryId").value;
|
||||||
|
|
||||||
if (!id || id === "None") {
|
if (!id || id === "None") {
|
||||||
renderToast({ message: "No item ID found to delete.", type: "danger }");
|
renderToast({ message: "No item ID found to delete.", type: "danger"} );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue