Files
ncd-fe/packages/pl-fe/src/api/hooks/groups/use-update-group.ts
nicole mikołajczyk a80bb6d938 pl-fe: change import alias so it won't change on each project rename
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
2026-02-07 22:41:47 +01:00

29 lines
691 B
TypeScript

import { Entities } from '@/entity-store/entities';
import { useCreateEntity } from '@/entity-store/hooks/use-create-entity';
import { useClient } from '@/hooks/use-client';
interface UpdateGroupParams {
display_name?: string;
note?: string;
avatar?: File | '';
header?: File | '';
group_visibility?: string;
discoverable?: boolean;
}
const useUpdateGroup = (groupId: string) => {
const client = useClient();
const { createEntity, ...rest } = useCreateEntity(
[Entities.GROUPS],
(params: UpdateGroupParams) => client.experimental.groups.updateGroup(groupId, params),
);
return {
updateGroup: createEntity,
...rest,
};
};
export { useUpdateGroup };