From c029f3200a3a3ca280962584931c5dc568d62e94 Mon Sep 17 00:00:00 2001 From: Alan Bridgeman Date: Tue, 21 Jul 2026 16:41:24 -0500 Subject: [PATCH] Minor change around save properties method prototype --- src/repos/PolyglotRepository.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/repos/PolyglotRepository.ts b/src/repos/PolyglotRepository.ts index f078e84..46c3632 100644 --- a/src/repos/PolyglotRepository.ts +++ b/src/repos/PolyglotRepository.ts @@ -68,6 +68,7 @@ export function createPolyglotRepository } const entityProps = await (adapterInstance as Record)[retrieveMethodName](partitionValue, rowValue); + return entityProps !== null ? entityProps : (entity.properties as TProps); } @@ -87,9 +88,6 @@ export function createPolyglotRepository } async saveProperties(entity: TEntity, properties: TProps): Promise { - const partitionValue = String(entity[this.partitionProp as keyof TEntity]); - const rowValue = String(entity[this.rowProp as keyof TEntity]); - const adapterInstance = this.getNoSQL(); const AdapterClass = adapterInstance.constructor as any; @@ -100,7 +98,8 @@ export function createPolyglotRepository throw new Error(`Polyglot setup failed: ${AdapterClass.name} must have methods decorated with @NoSQLRetrieve and @NoSQLSave`); } - await (adapterInstance as Record)[saveMethodName](partitionValue, rowValue, properties, entity); + await (adapterInstance as Record)[saveMethodName](entity); + return properties; }