mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-15 03:09:32 +02:00
Merge pull request #288 from R0m1k3/1.1
Fix display issues and adjust year range for publicities
This commit is contained in:
3 files changed
+5
-3
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 141 KiB |
@@ -34,9 +34,11 @@ export default function Publicities() {
|
||||
// Seuls les admins peuvent modifier/supprimer
|
||||
const canModify = user?.role === 'admin';
|
||||
|
||||
// Generate year options (current year ± 5 years)
|
||||
// Generate year options (2020 to current year + 5 years)
|
||||
const currentYear = new Date().getFullYear();
|
||||
const yearOptions = Array.from({ length: 11 }, (_, i) => currentYear - 5 + i);
|
||||
const startYear = 2020;
|
||||
const endYear = currentYear + 5;
|
||||
const yearOptions = Array.from({ length: endYear - startYear + 1 }, (_, i) => startYear + i);
|
||||
|
||||
const { data: publicities = [], isLoading } = useQuery({
|
||||
queryKey: ['/api/publicities', selectedYear, selectedStoreId],
|
||||
|
||||
+1
-1
@@ -2243,7 +2243,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
|
||||
res.json(publicities);
|
||||
} catch (error) {
|
||||
console.error(`❌ ERROR fetching publicities for year ${year}:`, error);
|
||||
console.error("❌ ERROR fetching publicities:", error);
|
||||
res.status(500).json({ message: "Failed to fetch publicities", error: (error as Error).message });
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user