Closes https://github.com/twentyhq/core-team-issues/issues/2215 Closes https://github.com/twentyhq/core-team-issues/issues/2216 Closes https://github.com/twentyhq/core-team-issues/issues/2218 ## Fields widget edition demo https://github.com/user-attachments/assets/08626d70-8fcb-4ae2-9222-10ef57e75f90 ## Dashboards still work https://github.com/user-attachments/assets/aa9a9c45-a0a2-481e-b132-bc52254778da
36 lines
737 B
TypeScript
36 lines
737 B
TypeScript
import { usePerformViewFieldGroupAPIPersist } from '@/views/hooks/internal/usePerformViewFieldGroupAPIPersist';
|
|
|
|
type UpdateViewFieldGroupInput = {
|
|
id: string;
|
|
name?: string;
|
|
position?: number;
|
|
isVisible?: boolean;
|
|
};
|
|
|
|
export const useUpdateViewFieldGroup = () => {
|
|
const { performViewFieldGroupAPIUpdate } =
|
|
usePerformViewFieldGroupAPIPersist();
|
|
|
|
const updateViewFieldGroup = async ({
|
|
id,
|
|
name,
|
|
position,
|
|
isVisible,
|
|
}: UpdateViewFieldGroupInput) => {
|
|
return performViewFieldGroupAPIUpdate([
|
|
{
|
|
input: {
|
|
id,
|
|
update: {
|
|
name,
|
|
position,
|
|
isVisible,
|
|
},
|
|
},
|
|
},
|
|
]);
|
|
};
|
|
|
|
return { updateViewFieldGroup };
|
|
};
|