Skip to content

Commit

Permalink
fix: ScheduleUpdateData type
Browse files Browse the repository at this point in the history
  • Loading branch information
magne4000 authored and vladfrangu committed Oct 30, 2023
1 parent adc4d25 commit 131bd50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/resource_clients/schedule.ts
Expand Up @@ -9,6 +9,7 @@ import {
parseDateFields,
catchNotFoundOrThrow,
cast,
MakeOptional,
} from '../utils';

export class ScheduleClient extends ResourceClient {
Expand Down Expand Up @@ -91,8 +92,9 @@ export type ScheduleCreateOrUpdateData = Partial<
| 'isEnabled'
| 'isExclusive'
| 'description'
| 'actions'
>
> & {
actions: MakeOptional<ScheduleAction, 'id'>[]
}
>;

export enum ScheduleActions {
Expand Down
2 changes: 2 additions & 0 deletions src/utils.ts
Expand Up @@ -200,3 +200,5 @@ export function cast<T>(input: unknown): T {
}

export type Dictionary<T = unknown> = Record<PropertyKey, T>;

export type MakeOptional<T, U extends keyof T> = Pick<T, Exclude<keyof T, U>> & Partial<Pick<T, U>>;

0 comments on commit 131bd50

Please sign in to comment.