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 } ) },