Fakultas Ilmu Komputer UI

Commit 95fa7610 authored by Ahmad Izzudin Alifyandra's avatar Ahmad Izzudin Alifyandra
Browse files

Merge branch 'function-forum-post' into 'master'

feat: Create post function

See merge request !162
parents 7dde4a64 433f085e
Pipeline #88959 passed with stage
in 16 minutes and 40 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({
...post,
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