pl-fe: migrate /api/v*/instance to tanstack query
Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
@ -3,9 +3,9 @@ import React from 'react';
|
||||
import { useIntl, defineMessages, FormattedMessage } from 'react-intl';
|
||||
|
||||
import { updateConfig } from 'pl-fe/actions/admin';
|
||||
import { useInstance } from 'pl-fe/api/hooks/instance/use-instance';
|
||||
import { RadioGroup, RadioItem } from 'pl-fe/components/radio';
|
||||
import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch';
|
||||
import { useInstance } from 'pl-fe/hooks/use-instance';
|
||||
import toast from 'pl-fe/toast';
|
||||
|
||||
type RegistrationMode = 'open' | 'approval' | 'closed';
|
||||
@ -37,7 +37,7 @@ const modeFromInstance = ({ registrations }: Instance): RegistrationMode => {
|
||||
const RegistrationModePicker: React.FC = () => {
|
||||
const intl = useIntl();
|
||||
const dispatch = useAppDispatch();
|
||||
const instance = useInstance();
|
||||
const { data: instance } = useInstance();
|
||||
|
||||
const mode = modeFromInstance(instance);
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import React from 'react';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
import { useInstance } from 'pl-fe/api/hooks/instance/use-instance';
|
||||
import List, { ListItem } from 'pl-fe/components/list';
|
||||
import { CardTitle } from 'pl-fe/components/ui/card';
|
||||
import Icon from 'pl-fe/components/ui/icon';
|
||||
import Stack from 'pl-fe/components/ui/stack';
|
||||
import { useFeatures } from 'pl-fe/hooks/use-features';
|
||||
import { useInstance } from 'pl-fe/hooks/use-instance';
|
||||
import { useOwnAccount } from 'pl-fe/hooks/use-own-account';
|
||||
import sourceCode from 'pl-fe/utils/code';
|
||||
|
||||
@ -14,7 +14,7 @@ import { DashCounter, DashCounters } from '../components/dashcounter';
|
||||
import RegistrationModePicker from '../components/registration-mode-picker';
|
||||
|
||||
const Dashboard: React.FC = () => {
|
||||
const instance = useInstance();
|
||||
const { data: instance } = useInstance();
|
||||
const features = useFeatures();
|
||||
const { account } = useOwnAccount();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user