aboutsummaryrefslogtreecommitdiff
path: root/src/client/DocServer.ts
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-09-12 05:21:29 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-09-12 05:21:29 -0400
commitcbb016dd4bec4ce1367314717adf85640ae51c93 (patch)
tree5ec6a588780eb5c5cc9c75619bd5656ee35d1a25 /src/client/DocServer.ts
parent6cff2800f0aa2069787ff43831d18898c851bf3b (diff)
sharing workflow supported
Diffstat (limited to 'src/client/DocServer.ts')
-rw-r--r--src/client/DocServer.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts
index 2cec1046b..4dea4f11c 100644
--- a/src/client/DocServer.ts
+++ b/src/client/DocServer.ts
@@ -144,7 +144,7 @@ export namespace DocServer {
* the server if the document has not been cached.
* @param id the id of the requested document
*/
- const _GetRefFieldImpl = (id: string): Promise<Opt<RefField>> => {
+ const _GetRefFieldImpl = (id: string, mongoCollection?: string): Promise<Opt<RefField>> => {
// an initial pass through the cache to determine whether the document needs to be fetched,
// is already in the process of being fetched or already exists in the
// cache
@@ -155,7 +155,7 @@ export namespace DocServer {
// synchronously, we emit a single callback to the server requesting the serialized (i.e. represented by a string)
// field for the given ids. This returns a promise, which, when resolved, indicates the the JSON serialized version of
// the field has been returned from the server
- const getSerializedField = Utils.EmitCallback(_socket, MessageStore.GetRefField, id);
+ const getSerializedField = Utils.EmitCallback(_socket, MessageStore.GetRefField, { id, mongoCollection });
// when the serialized RefField has been received, go head and begin deserializing it into an object.
// Here, once deserialized, we also invoke .proto to 'load' the document's prototype, which ensures that all
@@ -188,10 +188,10 @@ export namespace DocServer {
}
};
- let _GetRefField: (id: string) => Promise<Opt<RefField>> = errorFunc;
+ let _GetRefField: (id: string, mongoCollection?: string) => Promise<Opt<RefField>> = errorFunc;
- export function GetRefField(id: string): Promise<Opt<RefField>> {
- return _GetRefField(id);
+ export function GetRefField(id: string, mongoCollection = "newDocuments"): Promise<Opt<RefField>> {
+ return _GetRefField(id, mongoCollection);
}
export async function getYoutubeChannels() {