The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/views/setupWizard/hooks/useParameters.ts

20 lines
738 B

import type { ISetting } from '@rocket.chat/core-typings';
import { useMethod } from '@rocket.chat/ui-contexts';
import type { UseQueryResult } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query';
type SetupWizardParameters = {
settings: ISetting[];
serverAlreadyRegistered: boolean;
};
export const useParameters = (): Exclude<UseQueryResult<SetupWizardParameters, Error>, { data: undefined }> => {
const getSetupWizardParameters = useMethod('getSetupWizardParameters');
return useQuery(['setupWizard/parameters'], getSetupWizardParameters, {
initialData: {
settings: [],
serverAlreadyRegistered: false,
},
}) as Exclude<UseQueryResult<SetupWizardParameters, Error>, { data: undefined }>;
};