Skip to content

Commit 1f641c3

Browse files
committed
added comment about type
1 parent c9deb85 commit 1f641c3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

x-pack/plugins/actions/server/saved_objects/saved_objects_client_without_updates.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ type AlertSavedObjectsCreateOptions = Omit<SavedObjectsCreateOptions, 'id' | 'ov
99
type AlertSavedObjectsUpdateOptions = Omit<SavedObjectsCreateOptions, 'id' | 'overwrite'> &
1010
Pick<Required<SavedObjectsCreateOptions>, 'id' | 'overwrite'>;
1111

12+
/**
13+
* This type ensures that:
14+
* 1. We never accidentally call `update`
15+
* 2. We always specify `overwrite` when call `create` _with_ an `id`.
16+
*/
1217
export type SavedObjectsClientWithoutUpdates = Omit<
1318
SavedObjectsClientContract,
1419
'create' | 'update' | 'bulkUpdate'

0 commit comments

Comments
 (0)