Fakultas Ilmu Komputer UI

Commit 81375752 authored by Ahmad Izzudin Alifyandra's avatar Ahmad Izzudin Alifyandra
Browse files

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

refactor: Make the pic optional in create forum post function

See merge request !166
parents 0c4a7503 c2232b46
Pipeline #88968 passed with stage
in 10 minutes and 5 seconds
......@@ -6,15 +6,16 @@ type createPostParam = {
userId: string;
title: string;
content: string;
pic?: string;
};
export const createPost = async (post: createPostParam) => {
const db = firebase.firestore();
await db.collection("threads_" + getEnv()).add({
...post,
pic: post.pic || "",
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