pleroma/app/soapbox/hooks/api/groups/useDeleteGroup.ts
2023-04-03 15:19:10 -05:00

18 lines
No EOL
419 B
TypeScript

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