Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
PPL KI Ganjil 2021 2022
Clicks - Ecosystem Business
clicks-frontend
Commits
c2232b46
Commit
c2232b46
authored
Dec 04, 2021
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/service/firestore/forum/createPost.ts
View file @
c2232b46
...
...
@@ -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
(),
});
};
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment