Features: - Copy Previous Week (entries duplication) - Bulk Approve/Reject (admin workflow) - Overtime tracking (employee + admin views) - DayCard component with auto-save - PDF generation, email notifications - React + Tailwind frontend, Prisma + PostgreSQL backend - Docker deployment (3 containers)
24 lines
652 B
JavaScript
24 lines
652 B
JavaScript
const express = require('express');
|
|
const { authenticate } = require('../middleware/auth');
|
|
|
|
const router = express.Router();
|
|
|
|
router.use(authenticate);
|
|
|
|
// GET /api/homeowners — list active homeowners (for all authenticated users)
|
|
router.get('/', async (req, res) => {
|
|
try {
|
|
const homeowners = await req.prisma.homeowner.findMany({
|
|
where: { isActive: true },
|
|
orderBy: { name: 'asc' },
|
|
select: { id: true, name: true },
|
|
});
|
|
res.json({ homeowners });
|
|
} catch (err) {
|
|
console.error('Get homeowners error:', err);
|
|
res.status(500).json({ error: 'Failed to fetch homeowners' });
|
|
}
|
|
});
|
|
|
|
module.exports = router;
|