1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-24 17:51:14 +02:00

feat: make impact metrics config save call

This commit is contained in:
kwasniew 2025-08-29 11:09:18 +02:00
parent 5c78c5cbe2
commit 5124e4084b
No known key found for this signature in database
GPG Key ID: 43A7CBC24C119560
2 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@ const StyledHeaderTitle = styled(Typography)(({ theme }) => ({
export const FeatureImpactMetrics: FC = () => {
const feature = useRequiredPathParam('featureId');
const [modalOpen, setModalOpen] = useState(false);
const { updateImpactMetric } = useImpactMetricsApi();
const { createImpactMetric } = useImpactMetricsApi();
const {
metadata,
@ -60,7 +60,7 @@ export const FeatureImpactMetrics: FC = () => {
<ChartConfigModal
open={modalOpen}
onClose={() => setModalOpen(false)}
onSave={(data) => updateImpactMetric({ ...data, feature })}
onSave={(data) => createImpactMetric({ ...data, feature })}
initialConfig={undefined}
metricSeries={metricSeries}
loading={metadataLoading}

View File

@ -7,7 +7,7 @@ export const useImpactMetricsApi = () => {
propagateErrors: true,
});
const updateImpactMetric = useCallback(
const createImpactMetric = useCallback(
async (config: ImpactMetricsConfigSchema) => {
const path = `api/admin/impact-metrics/config`;
const req = createRequest(
@ -25,7 +25,7 @@ export const useImpactMetricsApi = () => {
);
return {
updateImpactMetric,
createImpactMetric,
errors,
loading,
};