diff --git a/app/[slug]/dashboard/guests/page.tsx b/app/[slug]/dashboard/guests/page.tsx index 0d68edc..5466928 100644 --- a/app/[slug]/dashboard/guests/page.tsx +++ b/app/[slug]/dashboard/guests/page.tsx @@ -5,6 +5,7 @@ import { AbstractApi, } from '@/app/api/abstract-api'; import { Group, GroupSerializer } from '@/app/lib/group'; import { Guest, GuestSerializer } from '@/app/lib/guest'; +import { getCsrfToken, getSlug } from '@/app/lib/utils'; import AffinitiesFormDialog from '@/app/ui/components/affinities-form-dialog'; import { classNames } from '@/app/ui/components/button'; import GroupFormDialog from '@/app/ui/components/group-form-dialog'; @@ -31,6 +32,16 @@ export default function Page() { }); } + function resetAffinities() { + fetch(`/api/${getSlug()}/groups/affinities/reset`, { + method: 'POST', + headers: { + 'Accept': 'application/json', + 'X-CSRF-TOKEN': getCsrfToken(), + } + }) + } + const [groupsLoaded, setGroupsLoaded] = useState(false); const [groups, setGroups] = useState>([]); const [groupBeingEdited, setGroupBeingEdited] = useState(undefined); @@ -70,7 +81,11 @@ export default function Page() {
- +
+ + +
+