fix: missed users service

This commit is contained in:
Wyatt Johnson
2018-07-11 16:49:54 -06:00
parent 871206740f
commit 70ff49ec4f
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ export const signup = ({ db }: SignupOptions): RequestHandler => async (
};
// Create the new user.
const user = await create(db, tenant.id, {
const user = await create(db, tenant, {
email,
username,
displayName,
@@ -63,7 +63,7 @@ export async function findOrCreateOIDCUser(
// FIXME: implement rules.
// Create the new user, as one didn't exist before!
user = await create(db, tenant.id, {
user = await create(db, tenant, {
username: null,
role: GQLUSER_ROLE.COMMENTER,
email,
+3 -2
View File
@@ -1,11 +1,12 @@
import { Db } from "mongodb";
import { Tenant } from "talk-server/models/tenant";
import { createUser, CreateUserInput } from "talk-server/models/user";
export type CreateUser = CreateUserInput;
export async function create(db: Db, tenantID: string, input: CreateUser) {
const user = await createUser(db, tenantID, input);
export async function create(db: Db, tenant: Tenant, input: CreateUser) {
const user = await createUser(db, tenant.id, input);
return user;
}