MCPcopy Create free account
hub / github.com/Hazrat-Ali9/Problem-Solving-Frontend / addComment

Function addComment

lib/firebase/comment.ts:16–27  ·  view source on GitHub ↗
(data: any)

Source from the content-addressed store, hash-verified

14import { COMMENTS } from "@/constant/article";
15
16export async function addComment(data: any) {
17 try {
18 const docRef = await addDoc(collection(db, COMMENTS), {
19 ...data,
20 createdAt: new Date(),
21 });
22 return docRef.id;
23 } catch (error) {
24 console.error("Error adding blog:", error);
25 throw error;
26 }
27}
28
29export async function getComments(): Promise<any> {
30 try {

Callers 1

handleSubmitFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected