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
95fa7610
Commit
95fa7610
authored
Dec 04, 2021
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/service/firestore/forum/createPost.ts
0 → 100644
View file @
95fa7610
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
(),
});
};
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