diff options
author | bob <bcz@cs.brown.edu> | 2019-02-07 16:04:32 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-02-07 16:04:32 -0500 |
commit | ccee60f591cdb00b04c4e5db0483420b9db7b7c8 (patch) | |
tree | 2e17f5fb25684fcca93e03d41bdd0db33b1cf1c2 /src/documents/Documents.ts | |
parent | 5b55e1b6081393989ca35d2964da9604c2a93802 (diff) |
simplified DB API and added a SocketStub class that should be replaced with an actual Socket-to-DB implementation.
Diffstat (limited to 'src/documents/Documents.ts')
-rw-r--r-- | src/documents/Documents.ts | 5 |
1 files changed, 3 insertions, 2 deletions
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; |