pleroma/app/soapbox/api/hooks/groups/useBlockGroupMember.ts

15 lines
473 B
TypeScript
Raw Normal View History

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