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
2794b140
Commit
2794b140
authored
Dec 04, 2021
by
angelin depthios
Committed by
Mohammad Faraz Abisha Mirza
Dec 04, 2021
Browse files
[BE] : Add comment function
parent
7dde4a64
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/service/firestore/ecosystem/addComment.ts
0 → 100644
View file @
2794b140
import
firebase
from
"
firebase
"
;
import
{
getEnv
}
from
"
../../../helpers/getEnv
"
;
export
const
addComments
=
async
(
threadId
:
string
,
comment
:
string
,
userId
:
string
)
=>
{
const
db
=
firebase
.
firestore
();
return
await
db
.
collection
(
"
threads_comments_
"
+
getEnv
()).
add
({
threadId
:
threadId
,
timestamp
:
firebase
.
firestore
.
FieldValue
.
serverTimestamp
(),
content
:
comment
,
userId
:
userId
,
});
};
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