Fakultas Ilmu Komputer UI

Commit 433f085e authored by Abraham Rudolf Brahmana's avatar Abraham Rudolf Brahmana
Browse files

feat: Create post function

parent 1ea53e4b
Pipeline #88951 passed with stage
in 10 minutes and 30 seconds
import firebase from "firebase";
import { getEnv } from "../../../helpers/getEnv";
type createPostParam = {
ecosystemId: string;
userId: string;
title: string;
content: string;
export const createPost = async (post: createPostParam) => {
const db = firebase.firestore();
await db.collection("threads_" + getEnv()).add({
commentCount: 0,
likeCount: 0,
pic: "",
timestamp: firebase.firestore.FieldValue.serverTimestamp(),
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