mirror of
https://github.com/wassname/talk.git
synced 2026-08-11 11:27:10 +08:00
feat: signup enhancements; more extensions to schema
This commit is contained in:
@@ -2,7 +2,6 @@ import { Db } from "mongodb";
|
||||
|
||||
import { Omit } from "talk-common/types";
|
||||
import {
|
||||
Comment,
|
||||
CommentStatus,
|
||||
createComment,
|
||||
CreateCommentInput,
|
||||
@@ -13,11 +12,7 @@ export type CreateComment = Omit<
|
||||
"status" | "action_counts"
|
||||
>;
|
||||
|
||||
export async function create(
|
||||
db: Db,
|
||||
tenantID: string,
|
||||
input: CreateComment
|
||||
): Promise<Comment> {
|
||||
export async function create(db: Db, tenantID: string, input: CreateComment) {
|
||||
// TODO: run the comment through the moderation phases.
|
||||
const comment = await createComment(db, tenantID, {
|
||||
status: CommentStatus.ACCEPTED,
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Db } from "mongodb";
|
||||
|
||||
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);
|
||||
|
||||
return user;
|
||||
}
|
||||
Reference in New Issue
Block a user