mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-30 11:19:59 +00:00
Refactor meal addition flow and improve date handling
Refactored add_meal_v2 routes to simplify and clarify the meal addition process, including renaming endpoints and templates, and introducing decorators for date and item selection. Updated daily_log2 to use user's timezone and display the selected date. Adjusted templates and barcode scan logic to match new routes and improved user experience.
This commit is contained in:
@@ -85,7 +85,7 @@
|
||||
goButton.addEventListener('click', () => {
|
||||
const value = searchBox.value.trim();
|
||||
if (value) {
|
||||
const baseURL = "{{url_for('add_meal.step3', input='!')}}";
|
||||
const baseURL = "{{url_for('add_meal_v2.add_existing', input='!')}}";
|
||||
window.location.href = baseURL.replace("!", encodeURIComponent(value));
|
||||
}
|
||||
});
|
||||
@@ -121,7 +121,7 @@
|
||||
if (result) {
|
||||
// Result found, this should post the barcode
|
||||
const codeText = result.getText();
|
||||
const baseURL = "{{url_for('add_meal.step3', input='!')}}";
|
||||
const baseURL = "{{url_for('add_meal_v2.add_existing', input='!')}}";
|
||||
window.location.href = baseURL.replace("!", encodeURIComponent(codeText));
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user