Fakultas Ilmu Komputer UI

Commit 2794b140 authored by angelin depthios's avatar angelin depthios Committed by Mohammad Faraz Abisha Mirza
Browse files

[BE] : Add comment function

parent 7dde4a64
import firebase from "firebase";
import { getEnv } from "../../../helpers/getEnv";
export const addComments = async (
threadId: string,
comment: string,
userId: string
) => {
const db = firebase.firestore();
return await db.collection("threads_comments_" + getEnv()).add({
threadId: threadId,
timestamp: firebase.firestore.FieldValue.serverTimestamp(),
content: comment,
userId: userId,
});
};
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment