Skip to content

Commit

Permalink
fix(core): remove nested partial when updating documents
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicbartl committed Jun 7, 2024
1 parent f859776 commit 48f5457
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 1 addition & 5 deletions packages/core/src/storage/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,4 @@ export type ModelDataWithId<T extends BaseModel> = Pick<T, 'id'> & ModelDataOnly

export type ModelQuery<T extends BaseModel> = Partial<ModelDataOnly<T>>;

type NestedPartial<T> = {
[K in keyof T]?: T[K] extends Array<infer R> ? Array<R> : NestedPartial<T[K]>;
};

export type PatchUpdate<T extends { id: string }> = Required<Pick<T, 'id'>> & Omit<NestedPartial<T>, 'id'>;
export type PatchUpdate<T extends { id: string }> = Required<Pick<T, 'id'>> & Omit<Partial<T>, 'id'>;
9 changes: 7 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 48f5457

Please sign in to comment.