mirror of
https://github.com/sstent/foodplanner.git
synced 2026-01-25 11:11:36 +00:00
tryiong to fix the details page
This commit is contained in:
2
main.py
2
main.py
@@ -1590,6 +1590,8 @@ async def weekly_menu_page(request: Request, db: Session = Depends(get_db)):
|
||||
})
|
||||
weekly_menus_data.append(wm_dict)
|
||||
|
||||
logging.info(f"DEBUG: Loading weekly menu page with {len(weekly_menus_data)} weekly menus")
|
||||
|
||||
return templates.TemplateResponse("weeklymenu.html", {
|
||||
"request": request,
|
||||
"weekly_menus": weekly_menus_data,
|
||||
|
||||
@@ -389,7 +389,8 @@ function createWeeklyMenu() {
|
||||
if (data.status === 'success') {
|
||||
bootstrap.Modal.getInstance(document.getElementById('createWeeklyMenuModal')).hide();
|
||||
form.reset();
|
||||
loadWeeklyMenus();
|
||||
// Reload the page to get updated data
|
||||
location.reload();
|
||||
} else {
|
||||
alert('Error creating weekly menu: ' + data.message);
|
||||
}
|
||||
@@ -492,7 +493,8 @@ function deleteWeeklyMenu(weeklyMenuId) {
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.status === 'success') {
|
||||
loadWeeklyMenus();
|
||||
// Reload the page to get updated data
|
||||
location.reload();
|
||||
} else {
|
||||
alert('Error deleting weekly menu: ' + data.message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user