mirror of
https://github.com/sstent/foodplanner.git
synced 2026-02-07 01:21:39 +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)
|
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", {
|
return templates.TemplateResponse("weeklymenu.html", {
|
||||||
"request": request,
|
"request": request,
|
||||||
"weekly_menus": weekly_menus_data,
|
"weekly_menus": weekly_menus_data,
|
||||||
|
|||||||
@@ -389,7 +389,8 @@ function createWeeklyMenu() {
|
|||||||
if (data.status === 'success') {
|
if (data.status === 'success') {
|
||||||
bootstrap.Modal.getInstance(document.getElementById('createWeeklyMenuModal')).hide();
|
bootstrap.Modal.getInstance(document.getElementById('createWeeklyMenuModal')).hide();
|
||||||
form.reset();
|
form.reset();
|
||||||
loadWeeklyMenus();
|
// Reload the page to get updated data
|
||||||
|
location.reload();
|
||||||
} else {
|
} else {
|
||||||
alert('Error creating weekly menu: ' + data.message);
|
alert('Error creating weekly menu: ' + data.message);
|
||||||
}
|
}
|
||||||
@@ -492,7 +493,8 @@ function deleteWeeklyMenu(weeklyMenuId) {
|
|||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data.status === 'success') {
|
if (data.status === 'success') {
|
||||||
loadWeeklyMenus();
|
// Reload the page to get updated data
|
||||||
|
location.reload();
|
||||||
} else {
|
} else {
|
||||||
alert('Error deleting weekly menu: ' + data.message);
|
alert('Error deleting weekly menu: ' + data.message);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user