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:
parent
e98fbf82cb
commit
f274904ce6
@ -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),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user