Adds session creation code in Auth.js (#4574)

This commit is contained in:
Florent Vilmart
2018-02-19 11:15:54 -05:00
committed by GitHub
parent b754d51e8e
commit 11c40dce97
5 changed files with 81 additions and 80 deletions

View File

@@ -511,7 +511,7 @@ class DatabaseController {
addRelation(key: string, fromClassName: string, fromId: string, toId: string) {
const doc = {
relatedId: toId,
owningId : fromId
owningId: fromId
};
return this.adapter.upsertOneObject(`_Join:${key}:${fromClassName}`, relationSchema, doc, doc);
}
@@ -658,7 +658,7 @@ class DatabaseController {
// Returns a promise for a list of owning ids given some related ids.
// className here is the owning className.
owningIds(className: string, key: string, relatedIds: string): Promise<string[]> {
owningIds(className: string, key: string, relatedIds: string[]): Promise<string[]> {
return this.adapter.find(joinTableName(className, key), relationSchema, { relatedId: { '$in': relatedIds } }, {})
.then(results => results.map(result => result.owningId));
}