- Added payment presentation logic to display payment status and due dates. - Introduced AttendeeNotesSection and AttendeePaymentsSection components for managing notes and payments. - Implemented forms for editing contact information and notes with validation. - Updated API to support attendee updates and added corresponding tests. - Improved attendance summary logic to reflect all visible sessions. - Enhanced UI with loading states and error handling for better user experience.
25 lines
856 B
TypeScript
25 lines
856 B
TypeScript
import type { UpdateAttendee } from '@gruperly/shared';
|
|
import { UpdateAttendeeSchema } from '@gruperly/shared';
|
|
import { Hono } from 'hono';
|
|
import { problemJson, resultJson, unauthorizedProblem } from '@/http/problem-details';
|
|
import { validate } from '@/http/validate';
|
|
import { UpdateAttendeeDetails } from './use-case';
|
|
|
|
const route = new Hono();
|
|
|
|
route.patch('/:groupId/attendees/:attendeeId', validate.json(UpdateAttendeeSchema), async (c) => {
|
|
const user = c.get('user');
|
|
if (!user) return problemJson(c, unauthorizedProblem(c.req.path));
|
|
|
|
const useCase = new UpdateAttendeeDetails();
|
|
const result = await useCase.execute({
|
|
groupId: c.req.param('groupId'),
|
|
attendeeId: c.req.param('attendeeId'),
|
|
userId: user.id,
|
|
input: c.req.valid('json') as UpdateAttendee,
|
|
});
|
|
return resultJson(c, result);
|
|
});
|
|
|
|
export default route;
|