Fakultas Ilmu Komputer UI

Commit b32a947f authored by Mohammad Faraz Abisha Mirza's avatar Mohammad Faraz Abisha Mirza
Browse files

Merge branch 'addCommentFunction' into 'master'

[BE] : Add comment function

See merge request !161
parents f1da1096 2794b140
Pipeline #88979 passed with stage
in 10 minutes and 40 seconds
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