Skip to content

Commit

Permalink
fix: proxy recover flag to client implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
finkef committed Apr 11, 2023
1 parent 788ab33 commit abb6c2e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-phones-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@model-ts/dynamodb": patch
---

fix: proxy recover flag to client implementation
19 changes: 13 additions & 6 deletions packages/dynamodb/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,22 +417,24 @@ export const getProvider = (client: Client) => {

load<
M extends DynamoDBModelConstructor<any>,
Null extends boolean = false
Null extends boolean = false,
Recover extends boolean = false
>(
this: M,
key: Key,
params?: Omit<GetOperation<M>, "_model" | "_operation" | "key"> & {
null?: Null
recover?: Recover
}
) {
return client.load<M, Null>(
return client.load<M, Null, Recover>(
{
_model: this,
_operation: "get",
key,
...params,
},
{ null: params?.null }
{ null: params?.null, recover: params?.recover }
)
},

Expand Down Expand Up @@ -629,21 +631,26 @@ export const getProvider = (client: Client) => {
})
},

load<M extends DynamoDBUnion, Null extends boolean = false>(
load<
M extends DynamoDBUnion,
Null extends boolean = false,
Recover extends boolean = false
>(
this: M,
key: Key,
params?: Omit<GetOperation<M>, "_model" | "_operation" | "key"> & {
null?: Null
recover?: Recover
}
) {
return client.load<M, Null>(
return client.load<M, Null, Recover>(
{
_model: this,
_operation: "get",
key,
...params,
},
{ null: params?.null }
{ null: params?.null, recover: params?.recover }
)
},

Expand Down

0 comments on commit abb6c2e

Please sign in to comment.