Skip to content

Commit

Permalink
feat: change request api uses orval types
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Oct 17, 2023
1 parent cf42a82 commit 955d0f4
Showing 1 changed file with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
import useAPI from '../useApi/useApi';
import { usePlausibleTracker } from '../../../usePlausibleTracker';

export interface IChangeSchema {
feature: string | null;
action:
| 'updateEnabled'
| 'addStrategy'
| 'updateStrategy'
| 'deleteStrategy'
| 'patchVariant'
| 'reorderStrategy'
| 'archiveFeature'
| 'updateSegment'
| 'addDependency'
| 'deleteDependency';
payload: string | boolean | object | number | undefined;
}
import {
ChangeRequestCreateSchema,
ChangeRequestOneOrManyCreateSchema,
} from '../../../../openapi';

export interface IChangeRequestConfig {
project: string;
Expand All @@ -33,7 +21,7 @@ export const useChangeRequestApi = () => {
const addChange = async (
project: string,
environment: string,
payload: IChangeSchema | IChangeSchema[],
payload: ChangeRequestOneOrManyCreateSchema,
) => {
trackEvent('change_request', {
props: {
Expand Down Expand Up @@ -97,7 +85,7 @@ export const useChangeRequestApi = () => {
project: string,
changeRequestId: number,
changeId: number,
payload: IChangeSchema,
payload: ChangeRequestCreateSchema,
) => {
const path = `api/admin/projects/${project}/change-requests/${changeRequestId}/changes/${changeId}`;
const req = createRequest(path, {
Expand Down

0 comments on commit 955d0f4

Please sign in to comment.