1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-27 13:49:10 +02:00

chore: use context in change request api

This commit is contained in:
Thomas Heartman 2024-02-02 16:26:41 +09:00
parent e98fbf82cb
commit f274904ce6
No known key found for this signature in database
GPG Key ID: BD1F880DAED1EE78

View File

@ -3,6 +3,7 @@ import { usePlausibleTracker } from '../../../usePlausibleTracker';
import { PlausibleChangeRequestState } from 'component/changeRequest/changeRequest.types'; import { PlausibleChangeRequestState } from 'component/changeRequest/changeRequest.types';
import { getUniqueChangeRequestId } from 'utils/unique-change-request-id'; import { getUniqueChangeRequestId } from 'utils/unique-change-request-id';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { useChangeRequestPlausibleContext } from 'component/changeRequest/ChangeRequestContext';
export interface IChangeSchema { export interface IChangeSchema {
feature: string | null; feature: string | null;
@ -33,6 +34,7 @@ export const useChangeRequestApi = () => {
propagateErrors: true, propagateErrors: true,
}); });
const { uiConfig } = useUiConfig(); const { uiConfig } = useUiConfig();
const { willOverwriteStrategyChanges } = useChangeRequestPlausibleContext();
const addChange = async ( const addChange = async (
project: string, project: string,
@ -75,6 +77,7 @@ export const useChangeRequestApi = () => {
props: { props: {
eventType: payload.state, eventType: payload.state,
previousState, previousState,
willOverwriteStrategyChanges,
id: getUniqueChangeRequestId(uiConfig, changeRequestId), id: getUniqueChangeRequestId(uiConfig, changeRequestId),
}, },
}); });