Fakultas Ilmu Komputer UI

Commit c2232b46 authored by Abraham Rudolf Brahmana's avatar Abraham Rudolf Brahmana
Browse files

refactor: Make the pic optional in create forum post function

parent 95fa7610
Pipeline #88967 passed with stage
in 10 minutes and 43 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