From abb6c2ecca8c961e1e5579b560a143d1fa9481a0 Mon Sep 17 00:00:00 2001 From: Fabian Finke Date: Tue, 11 Apr 2023 22:10:53 +0200 Subject: [PATCH] fix: proxy recover flag to client implementation --- .changeset/four-phones-join.md | 5 +++++ packages/dynamodb/src/provider.ts | 19 +++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 .changeset/four-phones-join.md diff --git a/.changeset/four-phones-join.md b/.changeset/four-phones-join.md new file mode 100644 index 0000000..7b07327 --- /dev/null +++ b/.changeset/four-phones-join.md @@ -0,0 +1,5 @@ +--- +"@model-ts/dynamodb": patch +--- + +fix: proxy recover flag to client implementation diff --git a/packages/dynamodb/src/provider.ts b/packages/dynamodb/src/provider.ts index 302f300..77d746c 100644 --- a/packages/dynamodb/src/provider.ts +++ b/packages/dynamodb/src/provider.ts @@ -417,22 +417,24 @@ export const getProvider = (client: Client) => { load< M extends DynamoDBModelConstructor, - Null extends boolean = false + Null extends boolean = false, + Recover extends boolean = false >( this: M, key: Key, params?: Omit, "_model" | "_operation" | "key"> & { null?: Null + recover?: Recover } ) { - return client.load( + return client.load( { _model: this, _operation: "get", key, ...params, }, - { null: params?.null } + { null: params?.null, recover: params?.recover } ) }, @@ -629,21 +631,26 @@ export const getProvider = (client: Client) => { }) }, - load( + load< + M extends DynamoDBUnion, + Null extends boolean = false, + Recover extends boolean = false + >( this: M, key: Key, params?: Omit, "_model" | "_operation" | "key"> & { null?: Null + recover?: Recover } ) { - return client.load( + return client.load( { _model: this, _operation: "get", key, ...params, }, - { null: params?.null } + { null: params?.null, recover: params?.recover } ) },