(blogId: string, data: any)
| 141 | }; |
| 142 | |
| 143 | export async function updateBlog(blogId: string, data: any) { |
| 144 | try { |
| 145 | await updateDoc(doc(db, BLOGS, blogId), data); |
| 146 | } catch (error) { |
| 147 | console.error("Error updating blog:", error); |
| 148 | throw error; |
| 149 | } |
| 150 | } |
| 151 | export async function deleteBlog(blogId: string) { |
| 152 | try { |
| 153 | // Reference to the comments collection |