Files
ncd-fe/src/api/hooks/groups/useUnmuteGroup.ts
2023-09-18 16:08:54 -05:00

18 lines
538 B
TypeScript

import { Entities } from 'soapbox/entity-store/entities';
import { useEntityActions } from 'soapbox/entity-store/hooks';
import { type Group, groupRelationshipSchema } from 'soapbox/schemas';
function useUnmuteGroup(group?: Group) {
const { createEntity, isSubmitting } = useEntityActions(
[Entities.GROUP_RELATIONSHIPS, group?.id as string],
{ post: `/api/v1/groups/${group?.id}/unmute` },
{ schema: groupRelationshipSchema },
);
return {
mutate: createEntity,
isSubmitting,
};
}
export { useUnmuteGroup };