feat: improved user creation

This commit is contained in:
Wyatt Johnson
2018-07-13 14:36:54 -06:00
parent 42d30af27b
commit a2a49b8e45
11 changed files with 246 additions and 91 deletions
+4 -4
View File
@@ -1,12 +1,12 @@
import { Db } from "mongodb";
import { Tenant } from "talk-server/models/tenant";
import { createUser, CreateUserInput } from "talk-server/models/user";
import { upsertUser, UpsertUserInput } from "talk-server/models/user";
export type CreateUser = CreateUserInput;
export type UpsertUser = UpsertUserInput;
export async function create(db: Db, tenant: Tenant, input: CreateUser) {
const user = await createUser(db, tenant.id, input);
export async function upsert(db: Db, tenant: Tenant, input: UpsertUser) {
const user = await upsertUser(db, tenant.id, input);
return user;
}