pleroma/app/soapbox/api/hooks/groups/useBlockGroupMember.ts
2023-06-27 09:24:29 -04:00

15 lines
No EOL
473 B
TypeScript

import { Entities } from 'soapbox/entity-store/entities';
import { useEntityActions } from 'soapbox/entity-store/hooks';
import type { Account, Group, GroupMember } from 'soapbox/schemas';
function useBlockGroupMember(group: Group, account: Account) {
const { createEntity } = useEntityActions<GroupMember>(
[Entities.GROUP_MEMBERSHIPS, account.id],
{ post: `/api/v1/groups/${group?.id}/blocks` },
);
return createEntity;
}
export { useBlockGroupMember };