From ccee60f591cdb00b04c4e5db0483420b9db7b7c8 Mon Sep 17 00:00:00 2001 From: bob Date: Thu, 7 Feb 2019 16:04:32 -0500 Subject: simplified DB API and added a SocketStub class that should be replaced with an actual Socket-to-DB implementation. --- src/documents/Documents.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/documents') diff --git a/src/documents/Documents.ts b/src/documents/Documents.ts index 90124d36c..ce9a1529d 100644 --- a/src/documents/Documents.ts +++ b/src/documents/Documents.ts @@ -123,7 +123,7 @@ export namespace Documents { Server.AddDocument(imageProto); return imageProto; } - return Server.GetDocument(imageProtoId, true)!; + return Server.GetField(imageProtoId) as Document; } export function ImageDocument(url: string, options: DocumentOptions = {}): Document { @@ -131,7 +131,8 @@ export namespace Documents { setupOptions(doc, options); doc.Set(KeyStore.Data, new ImageField(new URL(url))); Server.AddDocument(doc); - return Server.GetDocument(doc.Id, true)!; + var sdoc = Server.GetField(doc.Id) as Document; + return sdoc; } let collectionProto: Document; -- cgit v1.2.3-70-g09d2