1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-11-10 01:19:53 +01:00

Chore: use union types

This commit is contained in:
Thomas Heartman 2024-01-11 19:36:59 +05:30
parent 1cd9d3ffee
commit 4d2eca0cf3
No known key found for this signature in database
GPG Key ID: BD1F880DAED1EE78

View File

@ -3,7 +3,7 @@ import { IFeatureStrategy } from '../../interfaces/strategy';
import { IUser } from '../../interfaces/user';
import { SetStrategySortOrderSchema } from '../../openapi';
export interface IChangeRequest {
export type IChangeRequest = {
id: number;
title: string;
project: string;
@ -17,9 +17,15 @@ export interface IChangeRequest {
rejections: IChangeRequestApproval[];
comments: IChangeRequestComment[];
conflict?: string;
state: ChangeRequestState;
schedule?: ChangeRequestSchedule;
}
} & (
| {
state: Exclude<ChangeRequestState, 'Scheduled'>;
}
| {
state: 'Scheduled';
schedule: ChangeRequestSchedule;
}
);
export type ChangeRequestSchedule =
| {