Aanbod: RESTful routes zonder /admin, één OfferingDto en herordenen via PUT /offerings/order

Admin en bezoeker gebruiken dezelfde resource; alleen GET is anoniem, de rest vereist AdminOnly. OfferingAdminDto vervalt (displayOrder zit nu in OfferingDto), move-up/move-down zijn vervangen door de order-route die een onbekende of onvolledige lijst met 400 afwijst. De admin-frontend en alle tests zijn mee aangepast.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 13:06:08 +01:00
co-authored by Claude Sonnet 5.5
parent e6710781e5
commit bc763c8ef6
39 changed files with 968 additions and 395 deletions
@@ -1,10 +1,10 @@
import { useTranslation } from 'react-i18next';
import { Button } from '@/components/ui/button';
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
import type { OfferingAdminDto } from '../services/types';
import type { OfferingDto } from '../services/types';
interface DeleteOfferingDialogProps {
offering: OfferingAdminDto | null;
offering: OfferingDto | null;
isDeleting: boolean;
onConfirm: () => void;
onCancel: () => void;
@@ -9,10 +9,10 @@ import { Label } from '@/components/ui/label';
import { FieldError } from '@/components/ui/FieldError';
import { slugifyPreview } from '@/lib/slugify';
import { offeringFormSchema, type OfferingFormData } from '../schemas/offering';
import type { OfferingAdminDto } from '../services/types';
import type { OfferingDto } from '../services/types';
interface OfferingFormProps {
initialValues?: OfferingAdminDto;
initialValues?: OfferingDto;
onSubmit: (values: OfferingFormData) => void;
isSubmitting: boolean;
}
@@ -7,10 +7,10 @@ import { Button } from '@/components/ui/button';
import { TableCell, TableRow } from '@/components/ui/table';
import { useUpdateOffering } from '../services/useUpdateOffering';
import { useMoveOffering } from '../services/useMoveOffering';
import type { OfferingAdminDto } from '../services/types';
import type { OfferingDto } from '../services/types';
interface OfferingRowProps {
offering: OfferingAdminDto;
offering: OfferingDto;
isFirst: boolean;
isLast: boolean;
onDeleteRequested: () => void;
@@ -5,11 +5,11 @@ import { GripVertical } from 'lucide-react';
import { Table, TableBody, TableHead, TableHeader, TableRow } from '@/components/ui/table';
import { OfferingRow } from './OfferingRow';
import { useOfferingsDnd } from '../hooks/useOfferingsDnd';
import type { OfferingAdminDto } from '../services/types';
import type { OfferingDto } from '../services/types';
interface OfferingsListProps {
offerings: OfferingAdminDto[];
onDeleteRequested: (offering: OfferingAdminDto) => void;
offerings: OfferingDto[];
onDeleteRequested: (offering: OfferingDto) => void;
}
export function OfferingsList({ offerings, onDeleteRequested }: OfferingsListProps) {