Files
evidencija-rezija/app/[locale]/home/multi-bill-edit/[year]/[month]/MultiBillEditPage.tsx
Nikola Derežić 0145a2030d feat: add multi-bill-edit page for batch bill status updates
- Add getLocationsByMonth server action with aggregation pipeline to calculate hasAttachment
- Add updateMonth server action for bulk bill status updates with path revalidation
- Create multi-bill-edit page at /home/multi-bill-edit/[year]/[month]
- Implement MultiBillEdit component with toggle functionality for all bills
- Add BillToggleBadge component integration for consistent bill display
- Add "set all as paid/unpaid" toggle button for batch operations
- Implement server-side redirect with success message after save
- Add Suspense boundary with loading skeleton
- Update translations for multi-bill-edit feature (Croatian and English)
- Ensure data freshness with unstable_noStore and revalidatePath

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 17:45:27 +01:00

17 lines
574 B
TypeScript

import { notFound } from 'next/navigation';
import { MultiBillEdit } from '@/app/[locale]/home/multi-bill-edit/[year]/[month]/MultiBillEdit';
import { getLocationsByMonth } from '@/app/lib/actions/monthActions';
export default async function MultiBillEditPage({ year, month }: { year: number; month: number }) {
const locations = await getLocationsByMonth({ year, month });
if (!locations || locations.length === 0) {
return(notFound());
}
const result = <MultiBillEdit locations={locations} year={year} month={month} />;
return (result);
}