mirror of
https://github.com/wassname/talk.git
synced 2026-08-02 13:10:23 +08:00
fix: cleanups for asset
This commit is contained in:
@@ -1,21 +1,19 @@
|
||||
import { Db } from "mongodb";
|
||||
|
||||
import { Omit } from "talk-common/types";
|
||||
import {
|
||||
CommentStatus,
|
||||
createComment,
|
||||
CreateCommentInput,
|
||||
} from "talk-server/models/comment";
|
||||
import { GQLCOMMENT_STATUS } from "talk-server/graph/tenant/schema/__generated__/types";
|
||||
import { createComment, CreateCommentInput } from "talk-server/models/comment";
|
||||
import { Tenant } from "talk-server/models/tenant";
|
||||
|
||||
export type CreateComment = Omit<
|
||||
CreateCommentInput,
|
||||
"status" | "action_counts"
|
||||
>;
|
||||
|
||||
export async function create(db: Db, tenantID: string, input: CreateComment) {
|
||||
export async function create(db: Db, tenant: Tenant, input: CreateComment) {
|
||||
// TODO: run the comment through the moderation phases.
|
||||
const comment = await createComment(db, tenantID, {
|
||||
status: CommentStatus.ACCEPTED,
|
||||
const comment = await createComment(db, tenant.id, {
|
||||
status: GQLCOMMENT_STATUS.ACCEPTED,
|
||||
action_counts: {},
|
||||
...input,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user