feat: unify react-query query keys
This commit is contained in:
@@ -186,7 +186,7 @@ function ChooseConnectionSubstep(props) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await queryClient.invalidateQueries({
|
await queryClient.invalidateQueries({
|
||||||
queryKey: ['stepConnection', step.id],
|
queryKey: ['steps', step.id, 'connection'],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,7 @@ function DeleteRoleButton(props) {
|
|||||||
const handleConfirm = React.useCallback(async () => {
|
const handleConfirm = React.useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
await deleteRole();
|
await deleteRole();
|
||||||
queryClient.invalidateQueries({ queryKey: ['roles'] });
|
queryClient.invalidateQueries({ queryKey: ['admin', 'roles'] });
|
||||||
setShowConfirmation(false);
|
setShowConfirmation(false);
|
||||||
enqueueSnackbar(formatMessage('deleteRoleButton.successfullyDeleted'), {
|
enqueueSnackbar(formatMessage('deleteRoleButton.successfullyDeleted'), {
|
||||||
variant: 'success',
|
variant: 'success',
|
||||||
|
@@ -25,7 +25,6 @@ function DeleteUserButton(props) {
|
|||||||
try {
|
try {
|
||||||
await deleteUser();
|
await deleteUser();
|
||||||
queryClient.invalidateQueries({ queryKey: ['admin', 'users'] });
|
queryClient.invalidateQueries({ queryKey: ['admin', 'users'] });
|
||||||
queryClient.invalidateQueries({ queryKey: ['admin', 'user', userId] });
|
|
||||||
setShowConfirmation(false);
|
setShowConfirmation(false);
|
||||||
enqueueSnackbar(formatMessage('deleteUserButton.successfullyDeleted'), {
|
enqueueSnackbar(formatMessage('deleteUserButton.successfullyDeleted'), {
|
||||||
variant: 'success',
|
variant: 'success',
|
||||||
|
@@ -39,9 +39,9 @@ function Editor(props) {
|
|||||||
|
|
||||||
await updateStep({ variables: { input: mutationInput } });
|
await updateStep({ variables: { input: mutationInput } });
|
||||||
await queryClient.invalidateQueries({
|
await queryClient.invalidateQueries({
|
||||||
queryKey: ['stepConnection', step.id],
|
queryKey: ['steps', step.id, 'connection'],
|
||||||
});
|
});
|
||||||
await queryClient.invalidateQueries({ queryKey: ['flow', flow.id] });
|
await queryClient.invalidateQueries({ queryKey: ['flows', flow.id] });
|
||||||
},
|
},
|
||||||
[updateStep, flow.id, queryClient],
|
[updateStep, flow.id, queryClient],
|
||||||
);
|
);
|
||||||
@@ -63,7 +63,7 @@ function Editor(props) {
|
|||||||
|
|
||||||
const createdStepId = createdStep.data.createStep.id;
|
const createdStepId = createdStep.data.createStep.id;
|
||||||
setCurrentStepId(createdStepId);
|
setCurrentStepId(createdStepId);
|
||||||
await queryClient.invalidateQueries({ queryKey: ['flow', flow.id] });
|
await queryClient.invalidateQueries({ queryKey: ['flows', flow.id] });
|
||||||
},
|
},
|
||||||
[createStep, flow.id, queryClient],
|
[createStep, flow.id, queryClient],
|
||||||
);
|
);
|
||||||
|
@@ -48,7 +48,7 @@ export default function EditorLayout() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
await queryClient.invalidateQueries({ queryKey: ['flow', flowId] });
|
await queryClient.invalidateQueries({ queryKey: ['flows', flowId] });
|
||||||
},
|
},
|
||||||
[flowId, queryClient],
|
[flowId, queryClient],
|
||||||
);
|
);
|
||||||
@@ -71,7 +71,7 @@ export default function EditorLayout() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
await queryClient.invalidateQueries({ queryKey: ['flow', flowId] });
|
await queryClient.invalidateQueries({ queryKey: ['flows', flowId] });
|
||||||
},
|
},
|
||||||
[flowId, queryClient],
|
[flowId, queryClient],
|
||||||
);
|
);
|
||||||
|
@@ -28,7 +28,9 @@ function ContextMenu(props) {
|
|||||||
variables: { input: { id: flowId } },
|
variables: { input: { id: flowId } },
|
||||||
});
|
});
|
||||||
|
|
||||||
await queryClient.invalidateQueries({ queryKey: ['appFlows', appKey] });
|
await queryClient.invalidateQueries({
|
||||||
|
queryKey: ['apps', appKey, 'flows'],
|
||||||
|
});
|
||||||
enqueueSnackbar(formatMessage('flow.successfullyDuplicated'), {
|
enqueueSnackbar(formatMessage('flow.successfullyDuplicated'), {
|
||||||
variant: 'success',
|
variant: 'success',
|
||||||
SnackbarProps: {
|
SnackbarProps: {
|
||||||
@@ -54,7 +56,9 @@ function ContextMenu(props) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
await queryClient.invalidateQueries({ queryKey: ['appFlows', appKey] });
|
await queryClient.invalidateQueries({
|
||||||
|
queryKey: ['apps', appKey, 'flows'],
|
||||||
|
});
|
||||||
enqueueSnackbar(formatMessage('flow.successfullyDeleted'), {
|
enqueueSnackbar(formatMessage('flow.successfullyDeleted'), {
|
||||||
variant: 'success',
|
variant: 'success',
|
||||||
});
|
});
|
||||||
|
@@ -19,7 +19,7 @@ function FlowStepContextMenu(props) {
|
|||||||
async (event) => {
|
async (event) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
await deleteStep({ variables: { input: { id: stepId } } });
|
await deleteStep({ variables: { input: { id: stepId } } });
|
||||||
await queryClient.invalidateQueries({ queryKey: ['flow', flowId] });
|
await queryClient.invalidateQueries({ queryKey: ['flows', flowId] });
|
||||||
},
|
},
|
||||||
[stepId, queryClient],
|
[stepId, queryClient],
|
||||||
);
|
);
|
||||||
|
@@ -82,7 +82,7 @@ function TestSubstep(props) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await queryClient.invalidateQueries({
|
await queryClient.invalidateQueries({
|
||||||
queryKey: ['flow', flowId],
|
queryKey: ['flows', flowId],
|
||||||
});
|
});
|
||||||
}, [onSubmit, onContinue, isCompleted, queryClient, flowId]);
|
}, [onSubmit, onContinue, isCompleted, queryClient, flowId]);
|
||||||
|
|
||||||
|
@@ -94,7 +94,7 @@ export default function UsageDataInformation() {
|
|||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
queryKey: ['planAndUsage', currentUserId],
|
queryKey: ['users', currentUserId, 'planAndUsage'],
|
||||||
});
|
});
|
||||||
}, [subscription, queryClient, currentUserId]);
|
}, [subscription, queryClient, currentUserId]);
|
||||||
|
|
||||||
|
@@ -31,11 +31,11 @@ export const PaddleProvider = (props) => {
|
|||||||
// Paddle has side effects in the background,
|
// Paddle has side effects in the background,
|
||||||
// so we need to refetch the relevant queries
|
// so we need to refetch the relevant queries
|
||||||
await queryClient.refetchQueries({
|
await queryClient.refetchQueries({
|
||||||
queryKey: ['userTrial'],
|
queryKey: ['users', 'me', 'trial'],
|
||||||
});
|
});
|
||||||
|
|
||||||
await queryClient.refetchQueries({
|
await queryClient.refetchQueries({
|
||||||
queryKey: ['subscription'],
|
queryKey: ['users', 'me', 'subscription'],
|
||||||
});
|
});
|
||||||
|
|
||||||
navigate(URLS.SETTINGS_BILLING_AND_USAGE, {
|
navigate(URLS.SETTINGS_BILLING_AND_USAGE, {
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useActionSubsteps({ appKey, actionKey }) {
|
export default function useActionSubsteps({ appKey, actionKey }) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['actionSubsteps', appKey, actionKey],
|
queryKey: ['apps', appKey, 'actions', actionKey, 'substeps'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(
|
const { data } = await api.get(
|
||||||
`/v1/apps/${appKey}/actions/${actionKey}/substeps`,
|
`/v1/apps/${appKey}/actions/${actionKey}/substeps`,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useActions(appKey) {
|
export default function useActions(appKey) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['actions', appKey],
|
queryKey: ['apps', appKey, 'actions'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/apps/${appKey}/actions`, {
|
const { data } = await api.get(`/v1/apps/${appKey}/actions`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useAdminAppAuthClient(id) {
|
export default function useAdminAppAuthClient(id) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['adminAppAuthClient', id],
|
queryKey: ['admin', 'appAuthClients', id],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/admin/app-auth-clients/${id}`, {
|
const { data } = await api.get(`/v1/admin/app-auth-clients/${id}`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -3,13 +3,13 @@ import { useQuery } from '@tanstack/react-query';
|
|||||||
import api from 'helpers/api';
|
import api from 'helpers/api';
|
||||||
|
|
||||||
export default function useAdminSamlAuthProviderRoleMappings({
|
export default function useAdminSamlAuthProviderRoleMappings({
|
||||||
adminSamlAuthProviderId,
|
adminSamlAuthProviderId: providerId,
|
||||||
}) {
|
}) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['adminSamlAuthProviderRoleMappings', adminSamlAuthProviderId],
|
queryKey: ['admin', 'samlAuthProviders', providerId, 'roleMappings'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(
|
const { data } = await api.get(
|
||||||
`/v1/admin/saml-auth-providers/${adminSamlAuthProviderId}/role-mappings`,
|
`/v1/admin/saml-auth-providers/${providerId}/role-mappings`,
|
||||||
{
|
{
|
||||||
signal,
|
signal,
|
||||||
},
|
},
|
||||||
@@ -17,7 +17,7 @@ export default function useAdminSamlAuthProviderRoleMappings({
|
|||||||
|
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
enabled: !!adminSamlAuthProviderId,
|
enabled: !!providerId,
|
||||||
});
|
});
|
||||||
|
|
||||||
return query;
|
return query;
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useAdminSamlAuthProviders() {
|
export default function useAdminSamlAuthProviders() {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['adminSamlAuthProviders'],
|
queryKey: ['admin', 'samlAuthProviders'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get('/v1/admin/saml-auth-providers', {
|
const { data } = await api.get('/v1/admin/saml-auth-providers', {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -3,7 +3,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useAdminUser({ userId }) {
|
export default function useAdminUser({ userId }) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['admin', 'user', userId],
|
queryKey: ['admin', 'users', userId],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/admin/users/${userId}`, {
|
const { data } = await api.get(`/v1/admin/users/${userId}`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -3,7 +3,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useAdminUsers(page) {
|
export default function useAdminUsers(page) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['admin', 'users', page],
|
queryKey: ['admin', 'users', { page }],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/admin/users`, {
|
const { data } = await api.get(`/v1/admin/users`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useApp(appKey) {
|
export default function useApp(appKey) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['app', appKey],
|
queryKey: ['apps', appKey],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/apps/${appKey}`, {
|
const { data } = await api.get(`/v1/apps/${appKey}`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useAppAuth(appKey) {
|
export default function useAppAuth(appKey) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['appAuth', appKey],
|
queryKey: ['apps', appKey, 'auth'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/apps/${appKey}/auth`, {
|
const { data } = await api.get(`/v1/apps/${appKey}/auth`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -3,7 +3,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useAppConfig(appKey) {
|
export default function useAppConfig(appKey) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['appConfig', appKey],
|
queryKey: ['apps', appKey, 'config'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/apps/${appKey}/config`, {
|
const { data } = await api.get(`/v1/apps/${appKey}/config`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useAppConnections(appKey) {
|
export default function useAppConnections(appKey) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['appConnections', appKey],
|
queryKey: ['apps', appKey, 'connections'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/apps/${appKey}/connections`, {
|
const { data } = await api.get(`/v1/apps/${appKey}/connections`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useAppFlows({ appKey, page }, { enabled }) {
|
export default function useAppFlows({ appKey, page }, { enabled }) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['appFlows', appKey, page],
|
queryKey: ['apps', appKey, 'flows', { page }],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/apps/${appKey}/flows`, {
|
const { data } = await api.get(`/v1/apps/${appKey}/flows`, {
|
||||||
params: {
|
params: {
|
||||||
|
@@ -8,7 +8,7 @@ export default function useAutomatischInfo() {
|
|||||||
* So we can set the `staleTime` to Infinity
|
* So we can set the `staleTime` to Infinity
|
||||||
**/
|
**/
|
||||||
staleTime: Infinity,
|
staleTime: Infinity,
|
||||||
queryKey: ['automatischInfo'],
|
queryKey: ['automatisch', 'info'],
|
||||||
queryFn: async (payload, signal) => {
|
queryFn: async (payload, signal) => {
|
||||||
const { data } = await api.get('/v1/automatisch/info', { signal });
|
const { data } = await api.get('/v1/automatisch/info', { signal });
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@ export default function useConnectionFlows(
|
|||||||
{ enabled } = {},
|
{ enabled } = {},
|
||||||
) {
|
) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['connectionFlows', connectionId, page],
|
queryKey: ['connections', connectionId, 'flows', { page }],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/connections/${connectionId}/flows`, {
|
const { data } = await api.get(`/v1/connections/${connectionId}/flows`, {
|
||||||
params: {
|
params: {
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useCurrentUser() {
|
export default function useCurrentUser() {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['currentUser'],
|
queryKey: ['users', 'me'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/users/me`, {
|
const { data } = await api.get(`/v1/users/me`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -74,7 +74,7 @@ function useDynamicFields(stepId, schema) {
|
|||||||
}, [schema, formValues, getValues]);
|
}, [schema, formValues, getValues]);
|
||||||
|
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['dynamicFields', stepId, computedVariables],
|
queryKey: ['steps', stepId, 'dynamicFields', computedVariables],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.post(
|
const { data } = await api.post(
|
||||||
`/v1/steps/${stepId}/dynamic-fields`,
|
`/v1/steps/${stepId}/dynamic-fields`,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useExecution({ executionId }) {
|
export default function useExecution({ executionId }) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['execution', executionId],
|
queryKey: ['executions', executionId],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/executions/${executionId}`, {
|
const { data } = await api.get(`/v1/executions/${executionId}`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useExecutionSteps({ executionId }) {
|
export default function useExecutionSteps({ executionId }) {
|
||||||
const query = useInfiniteQuery({
|
const query = useInfiniteQuery({
|
||||||
queryKey: ['executionSteps', executionId],
|
queryKey: ['executions', executionId, 'executionSteps'],
|
||||||
queryFn: async ({ pageParam = 1, signal }) => {
|
queryFn: async ({ pageParam = 1, signal }) => {
|
||||||
const { data } = await api.get(
|
const { data } = await api.get(
|
||||||
`/v1/executions/${executionId}/execution-steps`,
|
`/v1/executions/${executionId}/execution-steps`,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useExecutions({ page }, { refetchInterval } = {}) {
|
export default function useExecutions({ page }, { refetchInterval } = {}) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['executions', page],
|
queryKey: ['executions', { page }],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/executions`, {
|
const { data } = await api.get(`/v1/executions`, {
|
||||||
params: {
|
params: {
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useFlow(flowId) {
|
export default function useFlow(flowId) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['flow', flowId],
|
queryKey: ['flows', flowId],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/flows/${flowId}`, {
|
const { data } = await api.get(`/v1/flows/${flowId}`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useInvoices() {
|
export default function useInvoices() {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['invoices'],
|
queryKey: ['users', 'invoices'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get('/v1/users/invoices', {
|
const { data } = await api.get('/v1/users/invoices', {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -3,7 +3,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function usePaddleInfo() {
|
export default function usePaddleInfo() {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['paddleInfo'],
|
queryKey: ['payment', 'paddleInfo'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get('/v1/payment/paddle-info', {
|
const { data } = await api.get('/v1/payment/paddle-info', {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function usePaymentPlans() {
|
export default function usePaymentPlans() {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['paymentPlans'],
|
queryKey: ['payment', 'plans'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get('/v1/payment/plans', {
|
const { data } = await api.get('/v1/payment/plans', {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function usePermissionCatalog() {
|
export default function usePermissionCatalog() {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['permissionCatalog'],
|
queryKey: ['admin', 'permissions', 'catalog'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get('/v1/admin/permissions/catalog', {
|
const { data } = await api.get('/v1/admin/permissions/catalog', {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function usePlanAndUsage(userId) {
|
export default function usePlanAndUsage(userId) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['planAndUsage', userId],
|
queryKey: ['users', userId, 'planAndUsage'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/users/${userId}/plan-and-usage`, {
|
const { data } = await api.get(`/v1/users/${userId}/plan-and-usage`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useRole({ roleId }) {
|
export default function useRole({ roleId }) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['role', roleId],
|
queryKey: ['admin', 'roles', roleId],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/admin/roles/${roleId}`, {
|
const { data } = await api.get(`/v1/admin/roles/${roleId}`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
export default function useRoles() {
|
export default function useRoles() {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
staleTime: 0,
|
staleTime: 0,
|
||||||
queryKey: ['roles'],
|
queryKey: ['admin', 'roles'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get('/v1/admin/roles', {
|
const { data } = await api.get('/v1/admin/roles', {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useSamlAuthProvider({ samlAuthProviderId } = {}) {
|
export default function useSamlAuthProvider({ samlAuthProviderId } = {}) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['samlAuthProvider', samlAuthProviderId],
|
queryKey: ['samlAuthProviders', samlAuthProviderId],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(
|
const { data } = await api.get(
|
||||||
`/v1/admin/saml-auth-providers/${samlAuthProviderId}`,
|
`/v1/admin/saml-auth-providers/${samlAuthProviderId}`,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useStepConnection(stepId) {
|
export default function useStepConnection(stepId) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['stepConnection', stepId],
|
queryKey: ['steps', stepId, 'connection'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/steps/${stepId}/connection`, {
|
const { data } = await api.get(`/v1/steps/${stepId}/connection`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useStepWithTestExecutions(stepId) {
|
export default function useStepWithTestExecutions(stepId) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['stepWithTestExecutions', stepId],
|
queryKey: ['steps', stepId, 'previousSteps'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/steps/${stepId}/previous-steps`, {
|
const { data } = await api.get(`/v1/steps/${stepId}/previous-steps`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -25,7 +25,7 @@ export default function useSubscription() {
|
|||||||
const [isPolling, setIsPolling] = React.useState(false);
|
const [isPolling, setIsPolling] = React.useState(false);
|
||||||
|
|
||||||
const { data } = useQuery({
|
const { data } = useQuery({
|
||||||
queryKey: ['subscription'],
|
queryKey: ['users', 'me', 'subscription'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/users/me/subscription`, {
|
const { data } = await api.get(`/v1/users/me/subscription`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useTriggerSubsteps({ appKey, triggerKey }) {
|
export default function useTriggerSubsteps({ appKey, triggerKey }) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['triggerSubsteps', appKey, triggerKey],
|
queryKey: ['apps', appKey, 'triggers', triggerKey, 'substeps'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(
|
const { data } = await api.get(
|
||||||
`/v1/apps/${appKey}/triggers/${triggerKey}/substeps`,
|
`/v1/apps/${appKey}/triggers/${triggerKey}/substeps`,
|
||||||
|
@@ -4,7 +4,7 @@ import api from 'helpers/api';
|
|||||||
|
|
||||||
export default function useTriggers(appKey) {
|
export default function useTriggers(appKey) {
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
queryKey: ['triggers', appKey],
|
queryKey: ['apps', appKey, 'triggers'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get(`/v1/apps/${appKey}/triggers`, {
|
const { data } = await api.get(`/v1/apps/${appKey}/triggers`, {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -42,7 +42,7 @@ export default function useUserTrial() {
|
|||||||
const formatMessage = useFormatMessage();
|
const formatMessage = useFormatMessage();
|
||||||
|
|
||||||
const { data } = useQuery({
|
const { data } = useQuery({
|
||||||
queryKey: ['userTrial'],
|
queryKey: ['users', 'me', 'trial'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get('/v1/users/me/trial', {
|
const { data } = await api.get('/v1/users/me/trial', {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -7,7 +7,7 @@ import api from 'helpers/api';
|
|||||||
export default function useVersion() {
|
export default function useVersion() {
|
||||||
const { data: notificationsData } = useAutomatischNotifications();
|
const { data: notificationsData } = useAutomatischNotifications();
|
||||||
const { data } = useQuery({
|
const { data } = useQuery({
|
||||||
queryKey: ['automatischVersion'],
|
queryKey: ['automatisch', 'version'],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
const { data } = await api.get('/v1/automatisch/version', {
|
const { data } = await api.get('/v1/automatisch/version', {
|
||||||
signal,
|
signal,
|
||||||
|
@@ -52,7 +52,6 @@ export default function EditUser() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
queryClient.invalidateQueries({ queryKey: ['admin', 'users'] });
|
queryClient.invalidateQueries({ queryKey: ['admin', 'users'] });
|
||||||
queryClient.invalidateQueries({ queryKey: ['admin', 'user', userId] });
|
|
||||||
|
|
||||||
enqueueSnackbar(formatMessage('editUser.successfullyUpdated'), {
|
enqueueSnackbar(formatMessage('editUser.successfullyUpdated'), {
|
||||||
variant: 'success',
|
variant: 'success',
|
||||||
|
Reference in New Issue
Block a user