bigbuffet-rw/app/soapbox/hooks/api/groups/useDeleteGroup.ts

18 lines
413 B
TypeScript
Raw Normal View History

2023-03-20 12:40:21 -07:00
import { Entities } from 'soapbox/entity-store/entities';
import { useEntityActions } from 'soapbox/entity-store/hooks';
import type { Group } from 'soapbox/schemas';
function useDeleteGroup() {
const { deleteEntity, isLoading } = useEntityActions<Group>(
[Entities.GROUPS],
{ delete: '/api/v1/groups/:id' },
);
return {
mutate: deleteEntity,
isLoading,
};
}
export { useDeleteGroup };