mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-18 13:48:58 +02:00
fix: lint
This commit is contained in:
parent
6af1acb8fc
commit
ede3d2d354
@ -1,6 +1,6 @@
|
||||
import { useCallback } from 'react';
|
||||
import { useImpactMetricsSettings } from 'hooks/api/getters/useImpactMetricsSettings/useImpactMetricsSettings.js';
|
||||
import {useImpactMetricsSettingsApi} from 'hooks/api/actions/useImpactMetricsSettingsApi/useImpactMetricsSettingsApi.js';
|
||||
import { useImpactMetricsSettingsApi } from 'hooks/api/actions/useImpactMetricsSettingsApi/useImpactMetricsSettingsApi.js';
|
||||
import type { ChartConfig, ImpactMetricsState, LayoutItem } from '../types.ts';
|
||||
|
||||
export const useImpactMetricsState = () => {
|
||||
@ -98,7 +98,10 @@ export const useImpactMetricsState = () => {
|
||||
charts: settings.charts || [],
|
||||
layout: settings.layout || [],
|
||||
loading: settingsLoading || actionLoading,
|
||||
error: settingsError || Object.keys(actionErrors).length > 0 ? actionErrors : undefined,
|
||||
error:
|
||||
settingsError || Object.keys(actionErrors).length > 0
|
||||
? actionErrors
|
||||
: undefined,
|
||||
addChart,
|
||||
updateChart,
|
||||
deleteChart,
|
||||
|
@ -14,7 +14,7 @@ export const useImpactMetricsSettingsApi = () => {
|
||||
path,
|
||||
{
|
||||
method: 'PUT',
|
||||
body: JSON.stringify(settings)
|
||||
body: JSON.stringify(settings),
|
||||
},
|
||||
'updateImpactMetricsSettings',
|
||||
);
|
||||
|
@ -4,10 +4,10 @@ import type { ImpactMetricsState } from 'component/impact-metrics/types.ts';
|
||||
|
||||
export const useImpactMetricsSettings = () => {
|
||||
const PATH = `api/admin/impact-metrics/settings`;
|
||||
const { data, refetch, loading, error } =
|
||||
useApiGetter<ImpactMetricsState>(formatApiPath(PATH), () =>
|
||||
fetcher(formatApiPath(PATH), 'Impact metrics settings'),
|
||||
);
|
||||
const { data, refetch, loading, error } = useApiGetter<ImpactMetricsState>(
|
||||
formatApiPath(PATH),
|
||||
() => fetcher(formatApiPath(PATH), 'Impact metrics settings'),
|
||||
);
|
||||
|
||||
return {
|
||||
settings: data || { charts: [], layout: [] },
|
||||
|
Loading…
Reference in New Issue
Block a user